Giter Site home page Giter Site logo

knit-demo's Introduction

knit-demo

Build Report Card

knit-demo is an example RPC service and gateway configuration built with Knit.

Its API is defined by a Protocol Buffer schema, and the service implementation serves the same data as is available using The Star Wars API.

Using the Demo Server

This example application, both the RPC services and the Knit gateway, is available to interact with at https://knit-demo.connect.build/.

You can use the sources in the ts folder of this repo as a client. You can edit the index.ts file to experiment with different queries.

Generated Code

The generated TypeScript code, both for using Connect and Knit, are available in this repo at https://github.com/bufbuild/knit-demo/tree/main/ts/gen

The generated Go code can be found in this repo at https://github.com/bufbuild/knit-demo/tree/main/go/gen

Building and Running

If you want to build the demo from source, you can do so using the go tool and the sources in this repo:

go install github.com/bufbuild/knit-demo/go/cmd/swapi-server

The go/cmd/swapi-server program is the backend Connect server for the API. It provides the same data as the API at https://swapi.dev. Once built/installed, you can run this without any command-line flags. By default, it listens on port 30485.

To access the Star Wars API via a Knit client, there are two options:

  • You can then run the knitgateway in the knit-go repo using the knitgateway.example.yaml config file in that repo. You will then have a Knit server on port 30480 that provides the Star Wars API.
  • You can instead run swapi-server with the --embed-gateway flag. With this flag, both the Connect API and the Knit Gateway run in the same process and on the same port. So you will have a Knit server on port 30485.

Status: Alpha

Knit is undergoing initial development and is not yet stable.

Legal

Offered under the Apache 2 license.

knit-demo's People

Contributors

chrispine avatar dependabot[bot] avatar emcfarlane avatar jhump avatar smallsamantha avatar srikrsna-buf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.