Create an index.js (or app.js) file in your project root. Calling express() creates an application instance that handles incoming HTTP requests and starts listening on a specified port.
How It Works
const app = express()creates the Express application object.app.get('/', handler)registers a route for HTTP GET requests to the root path.app.listen(PORT, callback)binds the server to a port such as3000.
ADVERTISEMENT