import { WelcomeController } from "./WelcomeController"; import { RequestHandler } from "../entities/RequestHandler"; import { AccountController } from "./AccountController"; /** * Controllers routes * * @author Pierre Hubert */ export enum RouteType { POST, // Default GET } export interface Route { type ?: RouteType, path: string, cb: (req : RequestHandler) => Promise | void, needLogin ?: boolean, // Default = true } export const Routes : Route[] = [ // Welcome controller {type: RouteType.GET, path: "/", cb: WelcomeController.HomeMessage, needLogin: false}, // Account controller {path: "/account/login", cb: AccountController.LoginUser, needLogin: false}, {path: "/user/connectUSER", cb: AccountController.LoginUser, needLogin: false}, // Legacy {path: "/account/logout", cb: AccountController.LogoutUser}, {path: "/user/disconnectUSER", cb: AccountController.LogoutUser}, // Legacy {path: "/account/id", cb: AccountController.CurrentUserID}, {path: "/user/getCurrentUserID", cb: AccountController.CurrentUserID}, // Legacy ]