Removed node server to be replaced with nginx through docker

This commit is contained in:
2022-08-14 19:50:25 +02:00
parent 3b98faeddd
commit 91c75198de
3 changed files with 4 additions and 61 deletions

View File

@@ -6,15 +6,13 @@
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "NODE_ENV=development webpack server", "dev": "NODE_ENV=development webpack server",
"build": "yarn build:ts-server && yarn build:webpack", "build": "yarn build:ts && yarn build:webpack",
"build:ts": "yarn build:ts-server && yarn build:ts-vue", "build:ts": "tsc --project tsconfig.json",
"build:ts-server": "tsc --project tsconfig.server.json",
"build:ts-vue": "tsc --project tsconfig.json",
"build:webpack": "NODE_ENV=production webpack-cli build --progress", "build:webpack": "NODE_ENV=production webpack-cli build --progress",
"postbuild": "cp public/dist/index.html public/index.html", "postbuild": "cp public/dist/index.html public/index.html",
"clean": "rm -r public/dist 2> /dev/null; rm public/index.html 2> /dev/null; rm -r lib 2> /dev/null", "clean": "rm -r public/dist 2> /dev/null; rm public/index.html 2> /dev/null; rm -r lib 2> /dev/null",
"start": "node lib/server.js", "start": "echo 'Start using docker, consult README'",
"lint": "eslint src server.ts --ext .ts,.vue", "lint": "eslint src --ext .ts,.vue",
"docs": "documentation build src/api.ts -f html -o docs/api && documentation build src/api.ts -f md -o docs/api.md" "docs": "documentation build src/api.ts -f html -o docs/api && documentation build src/api.ts -f md -o docs/api.md"
}, },
"dependencies": { "dependencies": {

View File

@@ -1,25 +0,0 @@
import express, { Express, Request, Response } from "express";
import path from "path";
const history = require("connect-history-api-fallback");
const publicPath = path.join(__dirname, "..", "public");
const app: Express = express();
app.get("/_healthz", (_, res) => {
res.status(200).send("ok");
});
app.use("/", express.static(publicPath));
app.use(history({ index: "/" }));
app.get("/", (req: Request, res: Response) => {
console.log("trying to get:", req.path);
res.sendFile(`${publicPath}/index.html`);
});
const port = process.env.PORT || 5001;
console.log("Server runnning at port:", port);
app.listen(port);

View File

@@ -1,30 +0,0 @@
{
"compilerOptions": {
"target": "esnext",
"outDir": "./lib",
"lib": ["es2017"],
"module": "commonjs",
"moduleResolution": "node",
"allowJs": true,
"alwaysStrict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"noEmit": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noImplicitAny": true,
"resolveJsonModule": true,
"declaration": true,
"sourceMap": false,
"preserveConstEnums": true,
"skipLibCheck": true,
"removeComments": false,
"strict": true,
"typeRoots": ["./node_modules/@types"]
},
"include": ["server.ts"]
}