mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2024-11-26 07:19:23 +00:00
28 lines
459 B
TypeScript
28 lines
459 B
TypeScript
|
import { WelcomeController } from "./WelcomeController";
|
||
|
import { RequestHandler } from "../models/RequestHandler";
|
||
|
|
||
|
/**
|
||
|
* Controllers routes
|
||
|
*
|
||
|
* @author Pierre Hubert
|
||
|
*/
|
||
|
|
||
|
export enum RouteType {
|
||
|
POST, // Default
|
||
|
GET
|
||
|
}
|
||
|
|
||
|
export interface Route {
|
||
|
type ?: RouteType,
|
||
|
path: string,
|
||
|
cb: (req : RequestHandler) => void,
|
||
|
|
||
|
}
|
||
|
|
||
|
export const Routes : Route[] = [
|
||
|
|
||
|
// Welcome controller
|
||
|
{type: RouteType.GET, path: "/", cb: WelcomeController.HomeMessage}
|
||
|
|
||
|
|
||
|
]
|