Removed node server to be replaced with nginx through docker
This commit is contained in:
10
package.json
10
package.json
@@ -6,15 +6,13 @@
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "NODE_ENV=development webpack server",
|
||||
"build": "yarn build:ts-server && yarn build:webpack",
|
||||
"build:ts": "yarn build:ts-server && yarn build:ts-vue",
|
||||
"build:ts-server": "tsc --project tsconfig.server.json",
|
||||
"build:ts-vue": "tsc --project tsconfig.json",
|
||||
"build": "yarn build:ts && yarn build:webpack",
|
||||
"build:ts": "tsc --project tsconfig.json",
|
||||
"build:webpack": "NODE_ENV=production webpack-cli build --progress",
|
||||
"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",
|
||||
"start": "node lib/server.js",
|
||||
"lint": "eslint src server.ts --ext .ts,.vue",
|
||||
"start": "echo 'Start using docker, consult README'",
|
||||
"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"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
25
server.ts
25
server.ts
@@ -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);
|
||||
@@ -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"]
|
||||
}
|
||||
Reference in New Issue
Block a user