add troubleshooting controller and field otherNationality
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
This commit is contained in:
parent
5c75c27470
commit
7fe0512a2f
8 changed files with 55 additions and 15 deletions
25
src/controllers/10-troubleshooting-controller.ts
Normal file
25
src/controllers/10-troubleshooting-controller.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import express from "express";
|
||||
import { Controller, Get, Path, Request, Route } from "tsoa";
|
||||
import { getFile } from "../utils/minio";
|
||||
|
||||
@Route("api/v1/troubleshooting")
|
||||
export class TroubleshootingController extends Controller {
|
||||
@Get()
|
||||
async get(@Request() req: express.Request) {
|
||||
return req.res?.redirect(await getFile(".troubleshooting/toc.json"));
|
||||
}
|
||||
|
||||
@Get("{category}/assets/{name}")
|
||||
async getAsset(@Request() req: express.Request, @Path() category: string, @Path() name: string) {
|
||||
return req.res?.redirect(await getFile(`.troubleshooting/${category}/assets/${name}`));
|
||||
}
|
||||
|
||||
@Get("{category}/page/{page}")
|
||||
async getContent(
|
||||
@Request() req: express.Request,
|
||||
@Path() category: string,
|
||||
@Path() page: string,
|
||||
) {
|
||||
return req.res?.redirect(await getFile(`.troubleshooting/${category}/${page}.md`));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue