Skip to content

Instantly share code, notes, and snippets.

@danivijay
Created December 16, 2017 12:39
Show Gist options
  • Save danivijay/8bc7174adb59f857f82b4e5dcacf5c7c to your computer and use it in GitHub Desktop.
Save danivijay/8bc7174adb59f857f82b4e5dcacf5c7c to your computer and use it in GitHub Desktop.
import express from 'express';
import path from 'path';
import open from 'open';
const port = 3000; //choose different, if this port not available
const 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