Adding views as git submodule

This commit is contained in:
Fabian Stamm 2020-03-09 18:09:30 +01:00
parent 8edfaba134
commit 78927bffe1
6 changed files with 54 additions and 2029 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "views_repo"]
path = views_repo
url = ./views_repo/

View File

@ -35,5 +35,6 @@
"By clicking on ALLOW, you allow this app to access the requested recources.": "Wenn sie ALLOW drücken, berechtigen sie die Applikation die beantragten Resourcen zu benutzen.", "By clicking on ALLOW, you allow this app to access the requested recources.": "Wenn sie ALLOW drücken, berechtigen sie die Applikation die beantragten Resourcen zu benutzen.",
"User": "User", "User": "User",
"No special token": "No special token", "No special token": "No special token",
"Login token invalid": "Login token invalid" "Login token invalid": "Login token invalid",
"No login token": "No login token"
} }

1982
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -6,13 +6,14 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"start": "node lib/index.js", "start": "node lib/index.js",
"install": "cd views && npm install", "install": "cd views && npm install && cd .. && git submodule init && git submodule update && cd views_repo && npm i ",
"build-doc": "apidoc -i src/ -p apidoc/", "build-doc": "apidoc -i src/ -p apidoc/",
"build-ts": "tsc", "build-ts": "tsc",
"build": "tsc && cd views && npm run build && cd ..", "build": "tsc && cd views && npm run build && cd .. && cd views_repo && npm run build",
"build-server": "tsc", "build-server": "tsc",
"watch-ts": "tsc -w", "watch-ts": "tsc -w",
"watch-views": "cd views && npm run watch", "watch-views": "cd views && npm run watch",
"watch-views_repo": "cd views_repo && npm run dev",
"watch-node": "nodemon --ignore ./views lib/index.js", "watch-node": "nodemon --ignore ./views lib/index.js",
"watch": "concurrently \"npm:watch-*\"" "watch": "concurrently \"npm:watch-*\""
}, },
@ -40,7 +41,6 @@
"@hibas123/config": "^1.1.0", "@hibas123/config": "^1.1.0",
"@hibas123/nodelogging": "^2.1.4", "@hibas123/nodelogging": "^2.1.4",
"@hibas123/nodeloggingserver_client": "^1.1.2", "@hibas123/nodeloggingserver_client": "^1.1.2",
"@hibas123/openauth-views": "file:../Views",
"@hibas123/safe_mongo": "^1.6.1", "@hibas123/safe_mongo": "^1.6.1",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"compression": "^1.7.4", "compression": "^1.7.4",

View File

@ -1,4 +1,4 @@
import { Router, IRouter, Request } from "express" import { Router, IRouter, Request, static as ServeStatic } from "express"
import GetLoginPage from "./login"; import GetLoginPage from "./login";
import GetAuthPage from "./authorize"; import GetAuthPage from "./authorize";
import promiseMiddleware from "../helper/promiseMiddleware"; import promiseMiddleware from "../helper/promiseMiddleware";
@ -29,10 +29,12 @@ ViewRouter.get("/register", (req, res) => {
res.send(GetRegistrationPage(req.__)); res.send(GetRegistrationPage(req.__));
}) })
ViewRouter.get("/login", (req, res) => { ViewRouter.use("/login", ServeStatic("./views_repo/build/login"));
res.setHeader("Cache-Control", "public, max-age=" + cacheTime);
res.send(GetLoginPage(req.__)) // ViewRouter.use("/login", (req, res) => {
}) // res.setHeader("Cache-Control", "public, max-age=" + cacheTime);
// res.send(GetLoginPage(req.__))
// })
ViewRouter.get("/code", (req, res) => { ViewRouter.get("/code", (req, res) => {
res.setHeader("Cache-Control", "no-cache"); res.setHeader("Cache-Control", "no-cache");

1
views_repo Submodule

@ -0,0 +1 @@
Subproject commit 415200de4fc88a905f5865c5fb1d98832114dfad