Updated loader comments and descriptions

ref #39
This commit is contained in:
Nicolai Ort 2020-12-20 19:01:03 +01:00
parent de91d491e5
commit 43a4f1118d
4 changed files with 7 additions and 3 deletions

View File

@ -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();

View File

@ -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');

View File

@ -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();

View File

@ -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."
}
}
},