UNPKG

airship-server

Version:

Airship is a framework for Node.JS & TypeScript that helps you to write big, scalable and maintainable API servers.

23 lines (18 loc) 634 B
import "reflect-metadata" import { Wrapper } from "../../../codeGen/infrastructure/Utils"; export function queryPath(path: string) { return (target: any) => { let constructor = target if (!constructor.queryPath) constructor.queryPath = {} if (!constructor.queryPath[constructor.name]) constructor.queryPath[constructor.name] = path } } export type ASRequestType = Wrapper<typeof ASRequest> export class ASRequest { public static queryPath: string public static getQueryPath(): string { return (this.queryPath as any)[this.prototype.constructor.name] } }