File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ function create (options) {
78
78
app . use ( express . static ( `${ process . cwd ( ) } /public` ) )
79
79
app . use ( express . static ( `${ process . cwd ( ) } /node_modules/purecss/build` ) )
80
80
81
+ if ( Array . isArray ( options . middlewares ) ) {
82
+ options . middlewares . forEach ( mw => app . use ( mw ) )
83
+ }
84
+
81
85
// Log in page / details
82
86
app . get ( '/' , ( req , res ) => {
83
87
if ( req . session && req . session . user ) {
@@ -150,7 +154,8 @@ function create (options) {
150
154
const _listen = app . listen . bind ( app )
151
155
app . listen = ( port , cb ) => {
152
156
app . options = setOptions ( extend ( true , { port} , app . options ) )
153
- return _listen ( port , cb )
157
+ const server = _listen ( port , cb )
158
+ return Object . assign ( app , { server} )
154
159
}
155
160
156
161
return app
You can’t perform that action at this time.
0 commit comments