Skip to content

Commit

Permalink
Updated build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jwayn committed Jun 6, 2022
1 parent 8de1773 commit d6e73f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

build
src/public
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "index.js",
"scripts": {
"dev": "nodemon ./src/index.ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "npx tsc"
},
"keywords": [],
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function App() {
if (window.localStorage.getItem("events")) {
setEvents(window.localStorage.getItem("events"));
}
});
}, []);

return (
<div className="App">
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Import the express in typescript file
import express from "express";
import cors from "cors";
import { join } from "node:path";

import EventRouter from "./routes/events";

Expand All @@ -17,6 +18,10 @@ app.use(express.static("src/public"));

// Routes
app.use("/api/event", EventRouter);
app.use(express.static(__dirname + "/public"));
app.get("*", (req, res) => {
res.sendFile(join(__dirname + "/public/index.html"));
});

// Server setup
app.listen(port, () => {
Expand Down

0 comments on commit d6e73f3

Please sign in to comment.