Skip to content

Instantly share code, notes, and snippets.

@BasanthVerma
Forked from ronanguilloux/simpleServer.js
Created June 27, 2016 12:58
Show Gist options
  • Save BasanthVerma/f0dd824f961d6ac81d7220083ac836cb to your computer and use it in GitHub Desktop.
Save BasanthVerma/f0dd824f961d6ac81d7220083ac836cb to your computer and use it in GitHub Desktop.
Damn Simple NodeJs Server demo
/*
* 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