Express.js using

I started using express.js to my backend and I am doing the 404 err page

const express = require('express');
const bodyParser = require('body-parser');
const app = express();
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());

app.use(async (req, res) => {
    res.status(404).json({ error: 'Not Found' });
});



app.listen(3000, async () => {
    console.log("\x1b[33mServer listening at http://localhost:3000\x1b[37m");
});

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top