2019-11-21 17:06:50 +00:00
|
|
|
import { WelcomeController } from "./WelcomeController";
|
2019-11-22 07:50:15 +00:00
|
|
|
import { RequestHandler } from "../entities/RequestHandler";
|
|
|
|
import { AccountController } from "./AccountController";
|
2019-11-21 17:06:50 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
2019-11-22 07:50:15 +00:00
|
|
|
{type: RouteType.GET, path: "/", cb: WelcomeController.HomeMessage},
|
2019-11-21 17:06:50 +00:00
|
|
|
|
2019-11-22 07:50:15 +00:00
|
|
|
// Account controller
|
|
|
|
{path: "/account/login", cb: AccountController.LoginUser},
|
|
|
|
{path: "/user/connectUSER", cb: AccountController.LoginUser}, // Legacy
|
2019-11-21 17:06:50 +00:00
|
|
|
]
|