Skip to content

Commit

Permalink
Added static path to serve frontend via express
Browse files Browse the repository at this point in the history
  • Loading branch information
s1hofmann committed Sep 17, 2020
1 parent 017ec93 commit 3e73dfa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backend/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import {Server} from "colyseus";
import {monitor} from "@colyseus/monitor";

import {TetrolyseusRoom} from "./TetrolyseusRoom";
import {join} from "path";

const port = Number(process.env.PORT || 2567);
const app = express()

const staticPath = join(__dirname, '../public');
console.log(`Using static path '${staticPath}'`);
app.use(express.static(staticPath));

app.use(cors());
app.use(express.json())

Expand Down

0 comments on commit 3e73dfa

Please sign in to comment.