Skip to content

Instantly share code, notes, and snippets.

@jczaplew
Last active January 4, 2016 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jczaplew/8641098 to your computer and use it in GitHub Desktop.
Save jczaplew/8641098 to your computer and use it in GitHub Desktop.
{
"name": "testApp",
"version": "0.0.1",
"description": "The simplest node server",
"main": "server.js",
"author": "John J Czaplewski",
"dependencies": {
"express": "3.x"
}
}
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