-
-
Save mh108/6d8a532cadd870098ceb083692b76b18 to your computer and use it in GitHub Desktop.
Our First Express Server, p. 192, Learning Web App Dev
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"), | |
http = require("http"), | |
app; | |
// Create our Express-powered HTTP server | |
// and have it listen on port 3000 | |
app = express(); | |
http.createServer(app).listen(3000); | |
// set up our routes | |
app.get("/hello", function(req, res) { | |
res.send("Hello World!"); | |
}); | |
app.get("/goodbye", function(req, res) { | |
res.send("Goodbye World!"); | |
}); | |
console.log("Server running on port 3000"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment