parent
de91d491e5
commit
43a4f1118d
|
@ -4,6 +4,7 @@ import { User } from '../models/entities/User';
|
|||
import SeedUsers from '../seeds/SeedUsers';
|
||||
/**
|
||||
* Loader for the database that creates the database connection and initializes the database tabels.
|
||||
* It also triggers the seeding process if no users got detected in the database.
|
||||
*/
|
||||
export default async () => {
|
||||
const connection = await createConnection();
|
||||
|
|
|
@ -2,7 +2,7 @@ import cookieParser from "cookie-parser";
|
|||
import { Application } from "express";
|
||||
/**
|
||||
* Loader for express related configurations.
|
||||
* Currently only enables the proxy trust.
|
||||
* Configures proxy trusts, globally used middlewares and other express features.
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
app.enable('trust proxy');
|
||||
|
|
|
@ -5,6 +5,7 @@ import openapiLoader from "./openapi";
|
|||
|
||||
/**
|
||||
* Index Loader that executes the other loaders in the right order.
|
||||
* This basicly exists for abstraction and a overall better dev experience.
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
await databaseLoader();
|
||||
|
|
|
@ -5,7 +5,8 @@ import { routingControllersToSpec } from "routing-controllers-openapi";
|
|||
import * as swaggerUiExpress from "swagger-ui-express";
|
||||
|
||||
/**
|
||||
* Loader for everything openapi related - from creating the schema to serving it via a static route.
|
||||
* Loader for everything openapi related - from creating the schema to serving it via a static route and swaggerUiExpress.
|
||||
* All auth schema related stuff also has to be configured here
|
||||
*/
|
||||
export default async (app: Application) => {
|
||||
const storage = getMetadataArgsStorage();
|
||||
|
@ -26,7 +27,8 @@ export default async (app: Application) => {
|
|||
"AuthToken": {
|
||||
"type": "http",
|
||||
"scheme": "bearer",
|
||||
"bearerFormat": "JWT"
|
||||
"bearerFormat": "JWT",
|
||||
description: "A JWT based access token. Use /api/auth/login or /api/auth/refresh to get one."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue