Express: What’s It Doing? In a Nutshell …
Let’s walk through an app and talk about all of it’s parts. Since there’s a lot of details, I’m going to stick to bullet-point format and walk through each line of code, putting explanations in layman’s terms. Here we go! Express API Here’s our app:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello World!') }) var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }) |
var express = require('express') Remember: we’re using Nodejs, which is sufficient on […]