https://github.com/nazmulhossain2905/express-2.o
Express Clone "Express 2.O".
https://github.com/nazmulhossain2905/express-2.o
express express-2o express-clone expressjs
Last synced: 3 months ago
JSON representation
Express Clone "Express 2.O".
- Host: GitHub
- URL: https://github.com/nazmulhossain2905/express-2.o
- Owner: NazmulHossain2905
- Created: 2024-08-29T04:00:52.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-08-29T05:31:48.000Z (9 months ago)
- Last Synced: 2025-02-21T18:14:11.796Z (3 months ago)
- Topics: express, express-2o, express-clone, expressjs
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Express 2.O
```javascript
const Express = require("./lib/Express");const app = new Express();
const port = 3000;app.get(
"/health",(req, res, next) => {
req.body.checking = "checking......";next();
},(req, res) => {
res.status(200).json({
success: true,
message: "Server health is Wealth",
checking: req.body?.checking,
method: req.method,
path: req.path,
user: {
name: "Nazmul Hossain",
email: "[email protected]",
country: "Bangladesh",
},
});
}
);app.post("/user", (req, res) => {
console.log(req.query);res.status(201).json({
success: true,
body: req.body,
method: req.method,
path: req.path,
});
});app.delete("/user", (req, res) => {
res.status(200).json({
success: true,
message: "Delete successfully",
method: req.method,
path: req.path,
});
});app.put("/user", (req, res) => {
res.status(200).json({
success: true,
message: "Update successfully",
method: req.method,
path: req.path,
});
});app.patch("/user", (req, res) => {
res.status(200).json({
success: true,
message: "Update successfully",
method: req.method,
path: req.path,
});
});app.listen(port, () =>
console.log(`Server is running at http://localhost:${port}`)
);
```