0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00
server/project/src/routers/dynamic/HttpDynamicRouter.ts

27 lines
918 B
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { DynamicRouter, RouteAction } from "@spt-aki/di/Router";
import { ImageRouter } from "@spt-aki/routers/ImageRouter";
2023-03-03 15:23:46 +00:00
@injectable()
2023-11-13 11:12:17 -05:00
export class HttpDynamicRouter extends DynamicRouter
2023-03-03 15:23:46 +00:00
{
constructor(@inject("ImageRouter") protected imageRouter: ImageRouter)
2023-03-03 15:23:46 +00:00
{
super([
new RouteAction(".jpg", (url: string, info: any, sessionID: string, output: string): any =>
{
return this.imageRouter.getImage();
}),
new RouteAction(".png", (url: string, info: any, sessionID: string, output: string): any =>
{
return this.imageRouter.getImage();
}),
new RouteAction(".ico", (url: string, info: any, sessionID: string, output: string): any =>
{
return this.imageRouter.getImage();
}),
]);
2023-03-03 15:23:46 +00:00
}
2023-11-13 11:12:17 -05:00
}