From a99ce5fc1461a8985e10afedd304ad0c59321f43 Mon Sep 17 00:00:00 2001 From: Cian Butler Date: Mon, 2 Oct 2023 21:31:50 +0100 Subject: [PATCH] fix type error --- package.json | 2 ++ pnpm-lock.yaml | 14 +++++++++++--- src/server/socketServer/assets.ts | 4 ++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index af30144c7..28de689be 100644 --- a/package.json +++ b/package.json @@ -113,6 +113,7 @@ "prom-client": "^14.0.1", "response-time": "^2.3.2", "sass": "^1.54.4", + "serve-static": "^1.15.0", "socket.io": "^4.5.1", "socket.io-client": "^4.5.1", "toastify-js": "^1.9.1", @@ -141,6 +142,7 @@ "@types/node": "^20.2.6", "@types/parseurl": "^1.3.1", "@types/response-time": "^2", + "@types/serve-static": "^1.15.3", "@types/sinon": "^10.0.13", "@types/toastify-js": "^1.9.2", "@types/yargs": "^17.0.24", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d581128b9..3c43bc9a6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,6 +64,9 @@ importers: sass: specifier: ^1.54.4 version: 1.67.0 + serve-static: + specifier: ^1.15.0 + version: 1.15.0 socket.io: specifier: ^4.5.1 version: 4.7.2 @@ -143,6 +146,9 @@ importers: '@types/response-time': specifier: ^2 version: 2.3.5 + '@types/serve-static': + specifier: ^1.15.3 + version: 1.15.3 '@types/sinon': specifier: ^10.0.13 version: 10.0.16 @@ -1227,7 +1233,7 @@ packages: '@types/body-parser': 1.19.3 '@types/express-serve-static-core': 4.17.36 '@types/qs': 6.9.8 - '@types/serve-static': 1.15.2 + '@types/serve-static': 1.15.3 dev: true /@types/fresh@0.5.0: @@ -1350,8 +1356,8 @@ packages: '@types/node': 20.6.2 dev: true - /@types/serve-static@1.15.2: - resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==} + /@types/serve-static@1.15.3: + resolution: {integrity: sha512-yVRvFsEMrv7s0lGhzrggJjNOSmZCdgCjw9xWrPr/kNNLp6FaDfMC1KaYl3TSJ0c58bECwNBMoQrZJ8hA8E1eFg==} dependencies: '@types/http-errors': 2.0.2 '@types/mime': 3.0.1 @@ -3983,6 +3989,8 @@ packages: dependencies: nan: 2.18.0 node-pre-gyp: 0.13.0 + transitivePeerDependencies: + - supports-color dev: false bundledDependencies: - node-pre-gyp diff --git a/src/server/socketServer/assets.ts b/src/server/socketServer/assets.ts index 509dc51de..f50606339 100644 --- a/src/server/socketServer/assets.ts +++ b/src/server/socketServer/assets.ts @@ -1,5 +1,5 @@ -import express from 'express'; +import serve from 'serve-static'; import { assetsPath } from './shared/path.js'; export const trim = (str: string): string => str.replace(/\/*$/, ''); -export const serveStatic = (path: string) => express.static(assetsPath(path)); +export const serveStatic = (path: string) => serve(assetsPath(path));