get creation of links working
This commit is contained in:
19
src/controllers/pages/app/AppController.ts
Normal file
19
src/controllers/pages/app/AppController.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { Controller } from "@tsed/di";
|
||||
import { HeaderParams } from "@tsed/platform-params";
|
||||
import { View } from "@tsed/platform-views";
|
||||
import { Hidden, Get, Returns } from "@tsed/schema";
|
||||
|
||||
@Hidden()
|
||||
@Controller("/app")
|
||||
export class AppController {
|
||||
@Get("/")
|
||||
@View("app/send.ejs")
|
||||
@(Returns(200, String).ContentType("text/html"))
|
||||
get(@HeaderParams("x-forwarded-proto") protocol: string, @HeaderParams("host") host: string) {
|
||||
const hostUrl = `${protocol || "http"}://${host}`;
|
||||
|
||||
return {
|
||||
BASE_URL: hostUrl
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user