diff --git a/server.mjs b/server.mjs index 75d9cbe..fc546bf 100644 --- a/server.mjs +++ b/server.mjs @@ -10,6 +10,7 @@ const rootDir = process.cwd(); const port = 3000; const app = express(); +app.use(express.static('spa/build')); app.get("/client.mjs", (_, res) => { res.header("Cache-Control", "private, no-cache, no-store, must-revalidate"); res.sendFile(path.join(rootDir, "client.mjs"), { @@ -22,6 +23,12 @@ app.get("/", (_, res) => { res.send(":)"); }); -app.listen(port, () => { - console.log(`App listening on port ${port}`); -}); +https.createServer( + { + key: fs.readFileSync("certs/server.key", 'utf8'), + cert: fs.readFileSync("certs/server.cert", 'utf8'), + },app).listen(3000, function () { + console.log("_");}); + +app.all('*', function(req, res) { + res.sendFile(path.join(rootDir, "/spa/build/index.html"));}); \ No newline at end of file