-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e09ead
commit 45b70a0
Showing
1 changed file
with
0 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1 @@ | ||
# Lets build a User Data API using NodeJS, ExpressJS, MongoDB and Mongoose | ||
|
||
## Table of contents | ||
|
||
- [Getting Started](#getting-started) | ||
- [Prerequisites](#prerequisites) | ||
- [Installation](#installation) | ||
- [Built With](#built-with) | ||
- [Author](#author) | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- NodeJS | ||
- MongoDB | ||
- Postman | ||
|
||
### Installation | ||
|
||
- Clone the repository | ||
- Type in the following command in the terminal | ||
|
||
```bash | ||
cd UserDataAPI | ||
npm install | ||
``` | ||
|
||
- Create a .env file in the root directory and add the following | ||
- Add your MongoDB connection string and desired port number | ||
|
||
```bash | ||
MONGO_URI = <YOUR_MONGODB_CONNECTION_STRING> | ||
PORT = <YOUR_DESIRED_PORT_NUMBER> | ||
``` | ||
|
||
- Populate the database by running the following command in the terminal | ||
|
||
```bash | ||
node populate.js | ||
``` | ||
|
||
- Run the following command in the terminal | ||
|
||
```bash | ||
npm start | ||
``` | ||
|
||
- Open Postman and test the API by sending requests to the following endpoints | ||
|
||
```bash | ||
GET http://localhost:3000/api/v1/users | ||
POST http://localhost:3000/api/v1/users | ||
GET http://localhost:3000/api/v1/users/:id(enter your own) | ||
PATCH http://localhost:3000/api/v1/users/:id(enter your own) | ||
DELETE http://localhost:3000/api/v1/users/:id(enter your own) | ||
``` | ||
|
||
## Built With | ||
|
||
- [NodeJS](https://nodejs.org/en/) | ||
- [ExpressJS](https://expressjs.com/) | ||
- [MongoDB](https://www.mongodb.com/) | ||
- [Mongoose](https://mongoosejs.com/) | ||
- [Postman](https://www.postman.com/) | ||
- [VS Code](https://code.visualstudio.com/) | ||
- [Git](https://git-scm.com/) | ||
|
||
## Author | ||
|
||
- Github - [therahulchaurasia](https://github.com/therahulchaurasia) |