From 07263baf6a9c2e96416e229b4f17d44a85a2daf0 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 14 Dec 2022 10:23:53 +0100 Subject: [PATCH] Serve ConnectForce using the server --- package-lock.json | 7 ++++--- packages/server/package.json | 1 + packages/server/src/main.js | 10 ++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 746738c..45bcac4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -498,9 +498,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.11.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.11.tgz", - "integrity": "sha512-KJ021B1nlQUBLopzZmPBVuGU9un7WJd/W4ya7Ih02B4Uwky5Nja0yGYav2EfYIk0RR2Q9oVhf60S2XR1BCWJ2g==", + "version": "18.11.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.15.tgz", + "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==", "dev": true }, "node_modules/@types/parse-glob": { @@ -9696,6 +9696,7 @@ }, "devDependencies": { "@types/express": "^4.17.15", + "@types/node": "^18.11.15", "noderel": "^1.0.13" } } diff --git a/packages/server/package.json b/packages/server/package.json index 4e50ded..07413bf 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@types/express": "^4.17.15", + "@types/node": "^18.11.15", "noderel": "^1.0.13" } } diff --git a/packages/server/src/main.js b/packages/server/src/main.js index ed9422a..caaa151 100644 --- a/packages/server/src/main.js +++ b/packages/server/src/main.js @@ -1,13 +1,11 @@ +import { join } from "path"; +import { fileURLToPath } from "url"; import express from "express"; +const dirname = fileURLToPath(new URL(".", import.meta.url)); const app = express(); -app.use( - (request, response, next) => - { - response.send("Hello World"); - response.status(100); - }); +app.use(express.static(join(dirname, "..", "..", "game", "lib", "static"))); app.use( [