Skip to content

Instantly share code, notes, and snippets.

@danivijay
Last active December 12, 2017 16:11
Show Gist options
  • Save danivijay/e0bb66f851f0bb3f49a797423f679070 to your computer and use it in GitHub Desktop.
Save danivijay/e0bb66f851f0bb3f49a797423f679070 to your computer and use it in GitHub Desktop.
file to place within buildScripts/
var express = require('express');
var path = require('path');
var open = require('open');
var port = 3000; //choose different, if this port not available
var app = express();
app.get('/',function(req, res) {
res.sendFile(path.join(__dirname, '../src/index.html'));
});
app.listen(port, function(err) {
if (err) {
console.log(err);
} else {
open('http://localhost:' + port);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment