Skip to content

Instantly share code, notes, and snippets.

@arvi
Last active July 20, 2016 10:49
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 arvi/d8b5c5671f797c998ac83f6b97583ec1 to your computer and use it in GitHub Desktop.
Save arvi/d8b5c5671f797c998ac83f6b97583ec1 to your computer and use it in GitHub Desktop.
Quick node server spin-up
var fs = require("fs");
var host = "127.0.0.1";
var port = 3000;
var express = require("express");
var app = express();
app.use(express.static(__dirname + "/")); //use static files in ROOT/public folder
app.get("/", function(request, response){ //root dir
response.send("Hello There");
});
app.listen(port, host, function() {
console.log('Connected to http://' + host + ':' + port);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment