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
Refringe 5740774a46
Apply Biome Formatting
This is the result of running `npm run format` which applies the Biome formatting rules. Rejoice!
2024-07-23 11:12:53 -04:00

30 lines
1.1 KiB
TypeScript

import { DynamicRouter, RouteAction } from "@spt/di/Router";
import { ImageRouter } from "@spt/routers/ImageRouter";
import { inject, injectable } from "tsyringe";
@injectable()
export class HttpDynamicRouter extends DynamicRouter {
constructor(@inject("ImageRouter") protected imageRouter: ImageRouter) {
super([
new RouteAction(
".jpg",
async (url: string, info: any, sessionID: string, output: string): Promise<string> => {
return this.imageRouter.getImage();
},
),
new RouteAction(
".png",
async (url: string, info: any, sessionID: string, output: string): Promise<string> => {
return this.imageRouter.getImage();
},
),
new RouteAction(
".ico",
async (url: string, info: any, sessionID: string, output: string): Promise<string> => {
return this.imageRouter.getImage();
},
),
]);
}
}