Add express.static() to serve semi-static files

+ Should be user-updateable in the future
This commit is contained in:
Stephan
2022-05-18 08:27:11 +02:00
committed by La_Felx
parent 510624cbc6
commit 323fc396f7
3 changed files with 16 additions and 0 deletions
+5
View File
@@ -11,6 +11,7 @@ import roleSchemaRouter from "./Routes/role_schema.routes";
import defaultErrorHandler from "./Middleware/error/handler";
import logger from "./Middleware/error/logger";
import debugLogger from "./Middleware/debug/logger";
import mediaRouter from "./Routes/media.routes";
// Set up async error handling
require("express-async-errors");
@@ -51,6 +52,7 @@ async function main() {
app.use("/api/admins", adminRouter);
<<<<<<< HEAD
app.use("/api/organisations", organisationRouter);
app.use("/api/groups", groupRouter);
@@ -61,6 +63,9 @@ async function main() {
// Error handling
app.use(defaultErrorHandler); // Not working
=======
app.use("/api/media", mediaRouter);
>>>>>>> Add express.static() to serve semi-static files
app.listen(process.env.PORT, () => {
logger.info(`Listening on port ${process.env.PORT}`);