gitfolio/run.js

23 lines
545 B
JavaScript
Raw Normal View History

2019-08-12 04:10:00 +00:00
const express = require("express");
const path = require("path");
const outDir = path.resolve("./dist/" || process.env.OUT_DIR);
const app = express();
2019-05-26 10:01:16 +00:00
app.use(express.static(`${outDir}`));
2019-08-12 04:10:00 +00:00
function runCommand(program) {
let port = program.port ? program.port : 3000;
2019-05-26 10:01:16 +00:00
2019-08-12 04:10:00 +00:00
app.get("/", function(req, res) {
res.sendFile("/index.html");
});
2019-08-12 04:10:00 +00:00
app.listen(port);
console.log(
`\nGitfolio running on port ${port}, Navigate to http://localhost:${port} in your browser\n`
);
}
module.exports = {
runCommand
2019-05-26 10:01:16 +00:00
};