Last active
July 20, 2016 10:49
-
-
Save arvi/d8b5c5671f797c998ac83f6b97583ec1 to your computer and use it in GitHub Desktop.
Quick node server spin-up
This file contains 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 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