@@ -67,43 +67,28 @@ class TServer {
67
67
68
68
_initApplications ( config ) {
69
69
70
- this . applications = express ( )
70
+ if ( config . case_sensitive_routing ) { this . applications . set ( 'case sensitive routing' , config . case_sensitive_routing ) }
71
+ if ( config . env ) { this . applications . set ( 'env' , config . env ) }
72
+ if ( config . etag ) { this . applications . set ( 'etag' , config . etag ) }
73
+ if ( config . jsonp_callback_name ) { this . applications . set ( 'jsonp callback name' , config . jsonp_callback_name ) }
74
+ if ( config . jsonp_escape ) { this . applications . set ( 'json escape' , config . jsonp_escape ) }
75
+ if ( config . jsonp_replacer ) { this . applications . set ( 'json replacer' , config . jsonp_replacer ) }
76
+ if ( config . jsonp_spaces ) { this . applications . set ( 'json spaces' , config . jsonp_spaces ) }
77
+ if ( config . query_parser ) { this . applications . set ( 'query parser' , config . query_parser ) }
78
+ if ( config . strict_routing ) { this . applications . set ( 'strict routing' , config . strict_routing ) }
79
+ if ( config . subdomain_offset ) { this . applications . set ( 'subdomain offset' , config . subdomain_offset ) }
80
+ if ( config . trust_proxy ) { this . applications . set ( 'trust proxy' , config . trust_proxy ) }
81
+ if ( config . views ) { this . applications . set ( 'views' , config . views ) }
82
+ if ( config . view_cache ) { this . applications . set ( 'view cache' , config . view_cache ) }
83
+ if ( config . view_engine ) { this . applications . set ( 'view engine' , config . view_engine ) }
84
+ if ( config . x_powered_by ) { this . applications . set ( 'x-powered-by' , config . x_powered_by ) }
71
85
72
- this . applications . set ( 'env' , config . env )
73
- this . applications . set ( 'hostName' , config . hostname )
74
- this . applications . set ( 'port' , config . port )
75
- this . applications . set ( 'db uri' , config . db_uri )
76
- this . applications . set ( 'views' , config . views )
77
- this . applications . set ( 'view engine' , config . view_engine )
78
- this . applications . set ( 'jsonp callback name' , config . jsonp_callback_name )
79
- this . applications . set ( 'json replacer' , config . jsonp_replacer )
80
- this . applications . set ( 'json spaces' , config . jsonp_spaces )
81
-
82
- if ( config . trust_proxy ) {
83
- this . applications . enable ( 'trust proxy' )
84
- } else {
85
- this . applications . disabled ( 'trust proxy' )
86
- }
86
+ this . _initMiddlewares ( config . middlewares )
87
87
88
- if ( config . case_sensitive_routing ) {
89
- this . applications . enable ( 'case sensitive routing' )
90
- } else {
91
- this . applications . disabled ( 'case sensitive routing' )
92
- }
88
+ }
93
89
94
- if ( config . strict_routing ) {
95
- this . applications . enable ( 'strict routing' )
96
- } else {
97
- this . applications . disabled ( 'strict routing' )
98
- }
99
90
100
- if ( config . view_cache ) {
101
- this . applications . enable ( 'view cache' )
102
- } else {
103
- this . applications . disabled ( 'view cache' )
104
- }
105
91
106
- this . _initMiddlewares ( config . middlewares )
107
92
108
93
}
109
94
0 commit comments