Tutorial project for JSON API in Node.js and Express framework.
Step-by-step guide on "How to create a simple JSON API in Node.js."
Check the full article here:
Each part of the above article corresponds to a separate branch. That branch will contain the source code as it was in the explained part.
Currently aviable parts and their branches:
-
Initialize an empty Node.js project.
-
Create a very simple web app.
-
Return a JSON response using the HTTP package.
-
Source code: https://github.com/CoderVlogger/nodejs-express-json-api/tree/step1-json-api-package-json
-
Introduce package.json for project dependencies.
-
Introduce nodemon to the project for hot-reload.
-
Shortly about GitHub repo for the course.
-
Source code: https://github.com/CoderVlogger/nodejs-express-json-api/tree/step1-json-api-package-json
-
Introduce Express.js - a popular Node-based web framework.
-
Convert pure Node HTTP app to Express.js application.
-
Source code: https://github.com/CoderVlogger/nodejs-express-json-api/tree/step2-express-js-server
In this part:
-
Using builtin Express.js function resp.json() to return a JSON body.
-
Routing and req.params for the input parameters in the URL.
-
Source code: https://github.com/CoderVlogger/nodejs-express-json-api/tree/step3-expressjs-json