# RouteService Service

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

# Overview

class RouteService {
<span class="token keyword">constructor</span><span class="token punctuation">(</span>platform<span class="token punctuation">:</span> <a href="/api/common/platform/services/Platform.html"><span class="token">Platform</span></a><span class="token punctuation">)</span><span class="token punctuation">;</span>
get <span class="token function">routes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/common/platform/interfaces/IRouteController.html"><span class="token">IRouteController</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token function">addRoutes</span><span class="token punctuation">(</span>routes<span class="token punctuation">:</span> <a href="/api/common/platform/interfaces/IRoute.html"><span class="token">IRoute</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <span class="token keyword">void</span><span class="token punctuation">;</span>
/**
 * Add a new route in the route registry
 * @param endpoint
 * @param token
 */
<span class="token function">addRoute</span><span class="token punctuation">(</span>endpoint<span class="token punctuation">:</span> <span class="token keyword">string</span><span class="token punctuation">,</span> token<span class="token punctuation">:</span> <a href="/api/di/interfaces/TokenProvider.html"><span class="token">TokenProvider</span></a><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/common/platform/services/Platform.html"><span class="token">Platform</span></a><span class="token punctuation">;</span>
/**
 * <a href="/api/common/mvc/decorators/method/Get.html"><span class="token">Get</span></a> all routes built by TsExpressDecorators and mounted on Express application.
 * @returns <span class="token punctuation">{</span><a href="/api/common/platform/interfaces/IRouteDetails.html"><span class="token">IRouteDetails</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">}</span>
 */
<span class="token function">getRoutes</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/common/platform/interfaces/IRouteDetails.html"><span class="token">IRouteDetails</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
/**
 * @deprecated <a href="/api/common/mvc/decorators/method/Use.html"><span class="token">Use</span></a> getRoutes instead of
 */
<span class="token function">getAll</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">:</span> <a href="/api/common/platform/interfaces/IRouteDetails.html"><span class="token">IRouteDetails</span></a><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>

}

# Description

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