Created
November 17, 2014 22:45
-
-
Save ronanguilloux/702b5468168b446934bf to your computer and use it in GitHub Desktop.
Damn Simple NodeJs Server demo
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
| /* | |
| * server.js | |
| * Copyright (C) 2014 ronan <ronan@MacBook-Pro-de-Ronan.local> | |
| * | |
| * Distributed under terms of the MIT license. | |
| */ | |
| // $ npm install connect | |
| // $ npm install serve-static | |
| // $ node simpleServer.js | |
| var connect = require('connect'), | |
| util = require('util'), | |
| serveStatic = require('serve-static'), | |
| port = 8001; | |
| var app = connect(); | |
| app.use(serveStatic('./')); | |
| app.listen(port); | |
| util.puts('Listening on ' + port + '...'); | |
| util.puts('Press Ctrl + C to stop.'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment