This tutorial walks through the project structure, implementing the controller, service, router and using the dependency injection pattern in a nodejs express application.
You can follow this tutorial and understand how this project work on this medium link.
npm install
npm start
Create a new user.
{
"name": "John Doe",
"email": "johndoe@example.com",
"password": "password123"
}
{
"id": 1,
"name": "John Doe",
"email": "johndoe@example.com"
}
Get a list of all users.
[
{
"id": 1,
"name": "John Doe",
"email": "johndoe@example.com"
},
{
"id": 2,
"name": "Jane Smith",
"email": "janesmith@example.com"
}
]
Get one user by id.
{
"id": 1,
"name": "John Doe",
"email": "johndoe@example.com"
}