|
|
@@ -2,7 +2,7 @@ import express, { json, NextFunction, Request, Response, urlencoded } from "expr
|
|
|
import { RegisterRoutes } from "../build/routes";
|
|
|
import { HtmlController } from "./routes/htmlControllers";
|
|
|
import swaggerUi from "swagger-ui-express";
|
|
|
-import { engine } from 'express-handlebars';
|
|
|
+import { create } from 'express-handlebars';
|
|
|
import path from "path";
|
|
|
import ConfigurationManager from "./config";
|
|
|
import slavery from "./slavery";
|
|
|
@@ -17,8 +17,9 @@ import {UnauthorizedMasterApiKey} from "./models/unauthorizedApi";
|
|
|
const app = express();
|
|
|
|
|
|
if (!ConfigurationManager.slave) {
|
|
|
- // Whiskers html template
|
|
|
- app.engine('handlebars', engine());
|
|
|
+ app.engine('handlebars', create({
|
|
|
+ partialsDir: path.join(__dirname, "../", "templates/partials")
|
|
|
+ }).engine);
|
|
|
app.set('view engine', 'handlebars');
|
|
|
app.set('views', path.join(__dirname, '../templates'));
|
|
|
}
|
|
|
@@ -62,7 +63,9 @@ import {UnauthorizedMasterApiKey} from "./models/unauthorizedApi";
|
|
|
app.use("/js/front.min.js", express.static(path.join(__dirname, "../build/"), {index: 'front.min.js'}));
|
|
|
app.use("/js/front.js.map", express.static(path.join(__dirname, "../build/"), {index: 'front.js.map'}));
|
|
|
app.use("/js/front.min.js.map", express.static(path.join(__dirname, "../build/"), {index: 'front.min.js.map'}));
|
|
|
- app.use(express.static(path.join(__dirname, 'public')));
|
|
|
+ app.use("/css/bootstrap.min.css", express.static(path.join(__dirname, "../node_modules/bootstrap/dist/css"), {index: 'bootstrap.min.css'}));
|
|
|
+ app.use("/css/bootstrap-select.min.css", express.static(path.join(__dirname, "../node_modules/bootstrap-select/dist/css"), {index: 'bootstrap-select.min.css'}));
|
|
|
+ app.use(express.static(path.join(__dirname, '../public')));
|
|
|
}
|
|
|
|
|
|
app.listen(ConfigurationManager.port,
|