Express
Express is a popular framework for setting up web servers with Node.js.
Benefits
- Simplicity: Express does not enforce a strict project structure, making it easy to get started quickly
- Vast ecosystem: There is a vast ecosystem of packages and plugins for extending Express functionality
- Broad adoption and stability: Express has been around for a long time, and is used by many companies in production.
- Great for prototyping: Favored for its simplicity for building proof of concept applications
Downsides
- Some Express libraries are outdated and can degrade performance
- Compared to more optimized frameworks like Fastify and Node's built-in http server, Express has noticeable performance overhead
- Does not have built-in TypeScript support
Tutorials
These tutorials showcase various common use cases for express
. The code examples are validated through the TypeScript bindings
for express
- you will need to copy the examples to your own computer and run TypeScript locally to see them in action.
Set up an Express application
Loading TypeScript...
You can now open http://localhost:8000 in your web browser to see the message that was sent.
Accept incoming requests
import express from 'express'const app = express()app.get('/', (req, res) => { res.send("")})
Rendering HTML pages
Now that your server is running, you can start rendering HTML.