@@ -13,17 +13,17 @@ import * as path from 'path';
1313 * The Http server main class.
1414 */
1515export class Server {
16- /**
17- * Create the routes for all classes decorated with our decorators
18- */
16+ /**
17+ * Create the routes for all classes decorated with our decorators
18+ */
1919 static buildServices ( router : express . Router , ...types : any [ ] ) {
2020 const iternalServer : InternalServer = new InternalServer ( router ) ;
2121 iternalServer . buildServices ( types ) ;
2222 }
2323
24- /**
25- * Return all paths accepted by the Server
26- */
24+ /**
25+ * Return all paths accepted by the Server
26+ */
2727 static getPaths ( ) : Array < string > {
2828 const result = new Array < string > ( ) ;
2929 InternalServer . getPaths ( ) . forEach ( value => {
@@ -33,19 +33,19 @@ export class Server {
3333 return result ;
3434 }
3535
36- /**
37- * Register a custom serviceFactory. It will be used to instantiate the service Objects
38- * If You plan to use a custom serviceFactory, You must ensure to call this method before any typescript-rest service declaration.
39- */
36+ /**
37+ * Register a custom serviceFactory. It will be used to instantiate the service Objects
38+ * If You plan to use a custom serviceFactory, You must ensure to call this method before any typescript-rest service declaration.
39+ */
4040 static registerServiceFactory ( serviceFactory : ServiceFactory ) {
4141 InternalServer . serviceFactory = serviceFactory ;
4242 }
4343
44- /**
45- * Configure the Server to use [typescript-ioc](https://github.com/thiagobustamante/typescript-ioc)
46- * to instantiate the service objects.
47- * If You plan to use IoC, You must ensure to call this method before any typescript-rest service declaration.
48- */
44+ /**
45+ * Configure the Server to use [typescript-ioc](https://github.com/thiagobustamante/typescript-ioc)
46+ * to instantiate the service objects.
47+ * If You plan to use IoC, You must ensure to call this method before any typescript-rest service declaration.
48+ */
4949 static useIoC ( ) {
5050 const ioc = require ( 'typescript-ioc' ) ;
5151 Server . registerServiceFactory ( {
@@ -67,10 +67,10 @@ export class Server {
6767 } ) ;
6868 }
6969
70- /**
71- * Return the set oh HTTP verbs configured for the given path
72- * @param path The path to search HTTP verbs
73- */
70+ /**
71+ * Return the set oh HTTP verbs configured for the given path
72+ * @param path The path to search HTTP verbs
73+ */
7474 static getHttpMethods ( path : string ) : Array < HttpMethod > {
7575 const result = new Array < HttpMethod > ( ) ;
7676 InternalServer . getHttpMethods ( path ) . forEach ( value => {
@@ -80,51 +80,51 @@ export class Server {
8080 return result ;
8181 }
8282
83- /**
84- * A string used for signing cookies. This is optional and if not specified,
85- * will not parse signed cookies.
86- * @param secret the secret used to sign
87- */
83+ /**
84+ * A string used for signing cookies. This is optional and if not specified,
85+ * will not parse signed cookies.
86+ * @param secret the secret used to sign
87+ */
8888 static setCookiesSecret ( secret : string ) {
8989 InternalServer . cookiesSecret = secret ;
9090 }
9191
92- /**
93- * Specifies a function that will be used to decode a cookie's value.
94- * This function can be used to decode a previously-encoded cookie value
95- * into a JavaScript string.
96- * The default function is the global decodeURIComponent, which will decode
97- * any URL-encoded sequences into their byte representations.
98- *
99- * NOTE: if an error is thrown from this function, the original, non-decoded
100- * cookie value will be returned as the cookie's value.
101- * @param decoder The decoder function
102- */
92+ /**
93+ * Specifies a function that will be used to decode a cookie's value.
94+ * This function can be used to decode a previously-encoded cookie value
95+ * into a JavaScript string.
96+ * The default function is the global decodeURIComponent, which will decode
97+ * any URL-encoded sequences into their byte representations.
98+ *
99+ * NOTE: if an error is thrown from this function, the original, non-decoded
100+ * cookie value will be returned as the cookie's value.
101+ * @param decoder The decoder function
102+ */
103103 static setCookiesDecoder ( decoder : ( val : string ) => string ) {
104104 InternalServer . cookiesDecoder = decoder ;
105105 }
106106
107- /**
108- * Set where to store the uploaded files
109- * @param dest Destination folder
110- */
107+ /**
108+ * Set where to store the uploaded files
109+ * @param dest Destination folder
110+ */
111111 static setFileDest ( dest : string ) {
112112 InternalServer . fileDest = dest ;
113113 }
114114
115- /**
116- * Set a Function to control which files are accepted to upload
117- * @param filter The filter function
118- */
115+ /**
116+ * Set a Function to control which files are accepted to upload
117+ * @param filter The filter function
118+ */
119119 static setFileFilter ( filter : ( req : Express . Request , file : Express . Multer . File ,
120120 callback : ( error : Error , acceptFile : boolean ) => void ) => void ) {
121121 InternalServer . fileFilter = filter ;
122122 }
123123
124- /**
125- * Set the limits of uploaded data
126- * @param limit The data limit
127- */
124+ /**
125+ * Set the limits of uploaded data
126+ * @param limit The data limit
127+ */
128128 static setFileLimits ( limit : number ) {
129129 InternalServer . fileLimits = limit ;
130130 }
0 commit comments