install dependencies
npm install express
import express and call it
const express = require('express');
const app = express();
Create an application on available port. For example I am using 5000 port.
app.listen(5000, () => {
console.log(`Example app listening on port 5000`);
});
Run your file with node
node server.js
Visit: http://localhost:5000 --> Wow, It's online.!
https://assignment-2-lake.vercel.app
userRouter.post('/', userController.createAUser);
userRouter.get('/', userController.getAllUsers);
userRouter.get('/:userId', userController.getSpecificUserByUserId);
userRouter.put('/:userId', userController.updateUserController);
userRouter.delete('/:userId', userController.userDeleteController);
userRouter.put('/:userId/orders', userController.userOrdersUpdateController);
userRouter.get('/:userId/orders', userController.userGetAllOrdersController);
userRouter.get(
'/:userId/orders/total-price',
userController.userGetOrdersTotalController,
);