<<<<<<< HEAD
Node JS GRPC Server with Express JS REST client using Mongo DB as database.
Make sure you have at least Node.js 10.16.0 installed.
You can check your Node.js version by running node -v:
$ node -v
v10.16.0
Navigate to your work directory and clone the project, change directory to the node-grpc
and add a new remote origin pointing to the new project repo.
$ git clone https://github.com/akinmaurice/node-grpc.git
$ cd node-grpc
You can set environment variables using .env
file, or setting them in your .bashrc
or .zshrc
file.
$ touch .env
# using any editor you prefer. (vim/nano/vi).
$ vim .env
Paste the following configuration variables with their corresponding values.
DATABASE_URI=VALUE
# open your bashrc or zshrc file,
# using any editor you prefer. (vim/nano/vi).
$ vim ~/.bashrc
Paste the following configuration variables with their corresponding values.
DATABASE_URI=VALUE
Run command to reload
$ source ~/.bashrc
Run command to install dependencies
$ npm install
Run command to start server on port 50051
$ npm run start-server
open a new terminal and run command to start client on port 3000
$ npm run start-client
The above will get you a copy of the project up and running on your local machine for development and testing purposes.
GET {{ base_uri }}/api/todos
{
"todos": [
{
"id": "215782",
"title": "Test Todo",
"completed": false
},
{
"id": "380484",
"title": "Running Man Todo",
"completed": false
},
{
"id": "541088",
"title": "Watch football",
"completed": false
}
]
}
GET {{ base_uri }}/api/todos/:id
{
"id": "609871",
"title": "Test Todo",
"completed": false
}
POST {{ base_uri }}/api/todos
parameters | Type | Description |
---|---|---|
title | string | Todo Title |
{
"id": "215782",
"title": "Test Todo",
"completed": false
}
DELETE {{ base_uri }}/api/todos/:id
{
"status": "true"
}
- gRPC
- MongoDB with Mongoose
- Node JS
- Express JS
This project is licensed under the MIT License - see the LICENSE.md file for details
42c7127 (Node.js (Backend) → gRPC Server → Mongoose → Node.js → React.js)