REST API for a user with Node, Express & MongoDB. In this project, use MVC architectural pattern.
HTTP Method | Route | Result |
---|---|---|
GET | api/v1/users | Get a list of users |
POST | api/v1/users | Create a new user |
GET | api/v1/users/:id | Get user |
PATCH | api/v1/users/:id | Update user |
DELETE | api/v1/users/:id | Delete user |
POST | api/v1/session/new | Get JWT |
Create a .env file like the below structure.
# === App ===
APP_URL=
APP_PORT=
APP_SECRET=
# === MongoDB ===
MONGO_URL=
MONGO_PORT=
MONGO_USERNAME=
MONGO_PASSWORD=
MONGO_DB_NAME=
# === Redis ===
REDIS_URL=
REDIS_PORT=
REDIS_USERNAME=
REDIS_PASSWORD=
First step
git clone https://github.com/amirkangarloo/rest-api-user.git
Second step
yarn install
Third step
Create a .env file.
Fourth step
yarn start