A simple nodejs api without any framework.
- Node.js
- Postman (optional for testing api)
-
server
- creates server and listens on a port 3000
-
controller
- handles requests
-
service
- handles business logic
-
model
- data
Run the following command from the root directory:
node server.js
Try the following urls in Postman.
-
Get request
-
Post request
- http://127.0.0.1:3000/post
- Body - > raw and JSON
- { "name" : "john" }
- http://127.0.0.1:3000/post
-
Invalid request