-
-
Save BasanthVerma/f0dd824f961d6ac81d7220083ac836cb 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 <[email protected]> | |
| * | |
| * 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