Setting Up an Express Server

Creating a basic Express server is simple and requires only a few lines of code.

const express = require('express');
const app = express();
app.listen(3000, () => console.log('Server running'));
  • app.get(), app.post() to handle routes
  • app.listen() to start the server
← PrevNext →