Created
June 22, 2013 14:14
-
-
Save timbergus/5841018 to your computer and use it in GitHub Desktop.
This is the basic structure to create a node server with express.
This file contains hidden or 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'); | |
| var app = express(); | |
| app.get('/', function(request, response) { | |
| response.send('<h1>Hello World!</h1>'); | |
| }); | |
| var port = process.env.PORT || 1337; | |
| app.listen(port, function() { | |
| console.log('Server working on http://localhost:' + port); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment