Setting up a nodejs server with persistency in data using NodeJS, Express and MongoDB which will perform the basic crud operations; which are: Create a new user record Read all records Read a single record Update a single user record Delete a single record
The finished app is deployed here on heroku Heroku deployment link
Clone the project
git clone https://github.com/samspecial/basic-crud-nodejs.git
Go to the project directory
cd my-project
Install dependencies
npm install
Start the server
npm start
Launch Postman
Use the API reference below to test the various endpoints in Postman
POST https://app-directory.herokuapp.com/users/
Parameter | Type | Description |
---|---|---|
name |
string |
Required. name of user to create |
email |
string |
Required. email of user to create |
country |
string |
Required. country of user to create |
GET https://app-directory.herokuapp.com/users/
Parameter | Type | Description |
---|---|---|
api_key |
string |
Not Required. |
GET https://app-directory.herokuapp.com/users/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of user to fetch |
PUT https://app-directory.herokuapp.com/users/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of user to update |
DELETE https://app-directory.herokuapp.com/users/${id}
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of user to delete |
If you have any feedback, please reach out to me at psalmueloye@gmail.com