There is RESTful API for Users management written in Nodejs/Express and MongoDB/mongoose.
The data is taken from
- https://jsonplaceholder.typicode.com/users
- https://jsonplaceholder.typicode.com/todos
- https://jsonplaceholder.typicode.com/posts
and stored in MongoDB in 3 respective collections.
There are 4 restful resources:
- users,
- todos,
- posts,
- phones.
Prerequisites : you need to install - Node - MongoDB - Robo visual tool - reccomended. - Postman to try the application.
Functionality: HTTP VERBS GET, POST, PUT, PATCH, DELETE on each resource.
Steps to reproduce.-
- Create directory Node - or whatever name you want, cd Node
-
- Inside there create directory changeLogs - name is important
as it is defined as constant in code:
nodefp/utils/LogHelper.js, function getLogFolder const LogFolderName = "/changeLogs";
- Inside there create directory changeLogs - name is important
-
- In MongoDb create Database nodefpDB - name is important.
nodefp/utils/DB.js file holds
const MONGODB_CONNECTION_PATH = 'mongodb://localhost:27017/nodefpDB';
- In MongoDb create Database nodefpDB - name is important.
nodefp/utils/DB.js file holds
-
- Clone: git clone https://github.com/avrahamm/avrahammNodeFP.git
-
- get into the directory, cd avrahammNodeFP
-
- npm install - to install dependencies.
-
- npm start , in server.js local server is set to listen on PORT 8002.
-
- Open Postman, the urls on your local will be
- http://localhost:8002/api/v1/users
- http://localhost:8002/api/v1/todos
- http://localhost:8002/api/v1/posts
- http://localhost:8002/api/v1/phones
configure HTTP VERBS and request data and try.
- Open Postman, the urls on your local will be