Express.js Playground

Give Feedback

Welcome to the Express Playground!

Use this interactive code editor to learn all the basic parts of an Express app.

As you type, the images on the right side will change depending on your code. You can also hover over text within the editor to learn more about it.

We will compare an Express app to running a restaurant. If you want more background, check out this guide called "Express.js Explained by Eating at a Restaurant"

const express = require('express'); const app = express(); app.use('/table', function(req, res, next){ let shirt = req.shirt; let shoes = req.shoes; if(shirt && shoes){ next(); } }); app.get('/table/:amount', function(req,res){ let party = req.params.amount; res.send('We are searching for your table for ' +party+'!'); }); app.listen(8080, function(){ console.log('We are open for business!'); });

Please fix errors!

The Manager/ Express

"Hi, my name is app."

"I make the rules."

Seating Rules/ Middleware

1. Must have shirt

2. Must have shoes

Seating Guests/ GET route

"I need to find a table for (amount)"

Restaurant Address/ Port

"We are open for business at 8080!"