Grokking Node.js
Vote

0% completed

​

What is Express.js and Why Use It?

Two small servers can print the same greeting and still behave very differently. The first one below uses only the http module that ships with Node.js, which an earlier chapter covered:

const http = require('http'); const server = http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello, World!'); }); server.listen(3000, () => { console.log('Server running on port 3000'); });

The second one uses Express.js, usually just called Express. It is a small web framework built on top of the same http module:

``

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content