| Level Navigation: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10⚡ | 11⚡ | 12⚡ | 13⚡ | 14⚡ | 15 | 16 | 17 | 18⚡ | 19 | 20 |
User Story: As a developer, I want to create a basic Express server so that I can handle web requests for my Mad Libs application.
Create a basic Express server that listens on port 3000.
npm install expressnpm install nodemon --save-devserver.js fileNeed help with Express setup? Check out these snippets:
app.get() to create routesconst express = require('express');
const app = express();
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});
app.get('/', (req, res) => {
res.send('Hello World!');
});
npm install to install dependenciesnpx nodemon server.js to start your serverhttp://localhost:3000