This node.js project is a small demo of how to implement many of the functional requirements present in everyday APIs we use.
It covers the following API Styles:
- REST: see
rest
folder. - GraphQL: see
graphql
folder. - gRPC: see
grpc
folder.
It has been developed using:
- express as the main app server.
- apollo-server-express, as an express middleware.
- mongoose, to model and access MongoDB objects.
- nodemon, to simplify the development process.
- @grpc/grpc-js, a pure JavaScript gRPC client.
- cors, an Express middleware to add CORS support to a web service.
- got, an HTTP client for node.js, used for WebHooks.
To install the dependencies, run npm install
.
Then configure your MongoDB in nodemon.json
.
To run the project, exec npm start
.
Finally, to turn to grpc client on, exec npm run grpcc
.
Also note, the GraphQL service has the graphiql web interface enabled for your convenience. It's available in /graphql
.