Last active
January 4, 2016 15:29
-
-
Save jczaplew/8641098 to your computer and use it in GitHub Desktop.
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
{ | |
"name": "testApp", | |
"version": "0.0.1", | |
"description": "The simplest node server", | |
"main": "server.js", | |
"author": "John J Czaplewski", | |
"dependencies": { | |
"express": "3.x" | |
} | |
} |
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'), | |
app = express(); | |
// Page routes | |
app.get('/:name', function(request, response) { | |
if (request.params.name) { | |
response.send("<p>Hello - " + request.params.name + "!</p>"); | |
} else { | |
response.send("<h1>Enter your name, son! Like /NAME"); | |
} | |
}); | |
app.listen(8080, function() { | |
console.log("Listening on port 8080"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment