

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Welcome to Web Servers
incomplete
2: Async TypeScript
incomplete
3: Setup
incomplete
4: Build
incomplete
5: Server
incomplete
6: Fileservers
incomplete
7: Fileserver Quiz
incomplete
8: Serving Images
incomplete
9: Workflow Tips
incomplete
10: Custom Handlers
incomplete
11: Request, Response
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
A fileserver is a kind of simple web server that serves static files from the host machine. Fileservers are often used to serve static assets for a website, things like:
Node.js with the express library makes it very easy to make a fileserver. Build and run a fileserver that serves a file called index.html from its root at http://localhost:8080. That file should contain this HTML:
<html>
<body>
<h1>Welcome to Chirpy</h1>
</body>
</html>
We'll cover what middleware is in a later lesson
import express from "express";
const app = express();
const PORT = 8080;
app.use(express.static("."));
app.listen(PORT, () => {
console.log(`Server is running at http://localhost:${PORT}`);
});
Run and submit the CLI tests.