Skip to content

Instantly share code, notes, and snippets.

@stestagg
Created May 21, 2020 00:43
Show Gist options
  • Save stestagg/9c42edfd14713db359a502da4c384f30 to your computer and use it in GitHub Desktop.
Save stestagg/9c42edfd14713db359a502da4c384f30 to your computer and use it in GitHub Desktop.
var express = require('express')
var http = require('http')
var path = require('path')
var reload = require('reload');
var app = express()
app.get('/', function (req, res) {
res.sendFile(path.join(__dirname, 'public', 'test.html'));
})
var server = http.createServer(app)
reload(app).then(function (reloadReturned) {
server.listen(3000, function () {});
setInterval(reloadReturned.reload, 5000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment