File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,10 +79,21 @@ export default class Application implements ArkstackRouterAwareCore<Express, unk
7979 // Load public assets
8080 await this . driver . mountPublicAssets ( this . app , path . join ( process . cwd ( ) , 'public' ) )
8181
82+ // Apply global middleware
83+ for ( const middleware of config ( this . app ) . global ) {
84+ await this . driver . applyMiddleware ( this . app , middleware )
85+ }
86+
87+ // Apply before middleware
88+ for ( const middleware of config ( this . app ) . before ) {
89+ await this . driver . applyMiddleware ( this . app , middleware )
90+ }
91+
8292 // Bind the router
8393 await this . driver . bindRouter ( this . app )
8494
85- for ( const middleware of config ( this . app ) . global ) {
95+ // Apply after middleware
96+ for ( const middleware of config ( this . app ) . after ) {
8697 await this . driver . applyMiddleware ( this . app , middleware )
8798 }
8899
Original file line number Diff line number Diff line change @@ -87,10 +87,21 @@ export default class Application implements ArkstackRouterAwareCore<H3, unknown>
8787 // Load public assets
8888 await this . driver . mountPublicAssets ( this . app , 'public' )
8989
90+ // Apply global middleware
91+ for ( const middleware of config ( this . app ) . global ) {
92+ await this . driver . applyMiddleware ( this . app , middleware )
93+ }
94+
95+ // Apply before middleware
96+ for ( const middleware of config ( this . app ) . before ) {
97+ await this . driver . applyMiddleware ( this . app , middleware )
98+ }
99+
90100 // Bind the router
91101 await this . driver . bindRouter ( this . app )
92102
93- for ( const middleware of config ( this . app ) . global ) {
103+ // Apply after middleware
104+ for ( const middleware of config ( this . app ) . after ) {
94105 await this . driver . applyMiddleware ( this . app , middleware )
95106 }
96107
You can’t perform that action at this time.
0 commit comments