# RouteService Service

Module
import { RouteService } from "@tsed/common"
Source/packages/common/src/mvc/services/RouteService.ts

# Overview

class RouteService {
    constructor(injector: InjectorService, expressApplication: ExpressApplication);
    get routes(): IRouteController[];
    addRoutes(routes: IRoute[]): void;
    addRoute(endpoint: string, token: TokenProvider): this;
    getRoutes(): IRouteDetails[];
    getAll(): IRouteDetails[];
}

# Description

RouteService is used to provide all routes collected by annotation @Controller.

# Members

get routes(): IRouteController[]

addRoutes(routes: IRoute[]): void

addRoute(endpoint: string, token: TokenProvider): this

Add a new route in the route registry


getRoutes(): IRouteDetails[]

Get all routes built by TsExpressDecorators and mounted on Express application.


getAll(): IRouteDetails[]