diff --git a/package.json b/package.json index 25b30d4..a070453 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "license": "MIT", "private": true, "dependencies": { + "app-root-path": "^3.0.0", "express": "^4.17.1", "express-ws": "^4.0.0", "heroku-ssl-redirect": "^0.0.4", diff --git a/src/server.js b/src/server.js new file mode 100644 index 0000000..875c365 --- /dev/null +++ b/src/server.js @@ -0,0 +1,14 @@ +const appRoot = require("app-root-path"); +const express = require("express"); +const sslRedirect = require("heroku-ssl-redirect"); + +const app = express(); +const host = process.env.HOST || "localhost"; +const port = parseInt(process.env.PORT) || 6119; + +app.use(sslRedirect()); +app.use("/", express.static(appRoot + "/static")); + +app.listen(port, host, () => + console.log(`Listening on http://${host}:${port}`) +); diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..c0008f1 --- /dev/null +++ b/static/index.html @@ -0,0 +1,10 @@ + + +
+ +