Express is the most popular web framework in the Node.js ecosystem. With Cerewro you can generate a complete REST API with authentication, validation, database and Swagger documentation in minutes.
Create a REST API with Node.js and Express to manage users and products: full CRUD routes, JWT authentication, Joi validation, SQLite connection and Swagger docs at /api-docs
const express = require('express');
const cors = require('cors');
const helmet = require('helmet');
const app = express();
app.use(helmet()); app.use(cors()); app.use(express.json());
app.use('/api/users', require('./routes/users'));
app.use('/api/products', require('./routes/products'));
app.listen(3000, () => console.log('API at http://localhost:3000'));
npm install -g pm2
pm2 start src/index.js --name "my-api"
pm2 startup && pm2 save
pm2 logs my-api