-
-
Save gld1982ltd/6944f88f8210e675cf83 to your computer and use it in GitHub Desktop.
Simple node.js server (livereload)
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
/* | |
* 1) run node server.js in root category where installed node | |
* 2) install browser extention | |
* 3) http://localhost:3000/index.html | |
*/ | |
//server settings | |
var serveStatic = require('serve-static'); | |
var connect = require('connect'); | |
var http = require('http'); | |
var app = connect(); | |
app.use(serveStatic(__dirname)); | |
//livereload | |
var livereload = require('livereload'); | |
var server = livereload.createServer(); | |
server.watch(__dirname); | |
http.createServer(app).listen(3000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment