node rest - Garuk-solutions/knowledge-base GitHub Wiki
REST stands for REpresentational State Transfer. It is an architectural style for providing standards between computer systems on the web, making it easier for systems to communicate with each other. REST-compliant systems, often called RESTful systems, are characterized by how they are stateless and separate the concerns of client and server.
A REST API is an application program interface (API) that uses HTTP requests to GET, PUT, POST and DELETE data.
- REST API is a simple way to create APIs.
- REST API is a lightweight and fast way to create APIs.
- REST API is a scalable way to create APIs.
- express
- body-parser
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});