File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,11 @@ var start = function(config) {
127
127
next ( ) ;
128
128
}
129
129
} ) ;
130
+
131
+ // Static files
132
+ app . use ( '/' , express . static ( path . resolve ( __dirname , '../build' ) ) ) ;
133
+
134
+ // Auth
130
135
app . use ( function ( req , res , next ) {
131
136
var doAuth = basicAuth ( function ( user , pass , fn ) {
132
137
users . auth ( user , pass )
@@ -139,14 +144,6 @@ var start = function(config) {
139
144
if ( req . session . userId || ! config . auth . basic ) return next ( ) ;
140
145
doAuth ( req , res , next ) ;
141
146
} ) ;
142
-
143
- // Static files
144
- app . use ( '/' , express . static ( path . resolve ( __dirname , '../build' ) ) ) ;
145
- app . use ( '/packages' , _middleware ( function ( ) {
146
- return express . static ( config . packages . root ) ;
147
- } ) ) ;
148
-
149
- // Auth
150
147
app . use ( function ( req , res , next ) {
151
148
if ( req . user ) {
152
149
req . session . userId = req . user . id ;
@@ -169,6 +166,11 @@ var start = function(config) {
169
166
}
170
167
} ) ;
171
168
169
+ // Download packages
170
+ app . use ( '/packages' , _middleware ( function ( ) {
171
+ return express . static ( config . packages . root ) ;
172
+ } ) ) ;
173
+
172
174
// RPC services
173
175
app . use ( '/rpc' , rpc . router ) ;
174
176
You can’t perform that action at this time.
0 commit comments