@@ -40,10 +40,10 @@ app.use(express.static(path.join(__dirname, 'public')));
40
40
//use nginx in production
41
41
if ( app . get ( 'env' ) === 'development' ) {
42
42
app . all ( '*' , function ( req , res , next ) {
43
- res . header ( "Access-Control-Allow-Origin" , "*" ) ;
44
- res . header ( "Access-Control-Allow-Headers" , "Origin, X-Requested-With, Content-Type, Accept, Authorization" ) ;
45
- res . header ( "Access-Control-Allow-Methods" , "PUT,POST,GET,PATCH,DELETE,OPTIONS" ) ;
46
- next ( ) ;
43
+ res . header ( "Access-Control-Allow-Origin" , "*" ) ;
44
+ res . header ( "Access-Control-Allow-Headers" , "Origin, X-Requested-With, Content-Type, Accept, Authorization" ) ;
45
+ res . header ( "Access-Control-Allow-Methods" , "PUT,POST,GET,PATCH,DELETE,OPTIONS" ) ;
46
+ next ( ) ;
47
47
} ) ;
48
48
}
49
49
@@ -53,7 +53,8 @@ if (_.get(config, 'common.storageType') === 'local'
53
53
&& _ . get ( config , 'local.storageDir' )
54
54
) {
55
55
if ( ! fs . existsSync ( _ . get ( config , 'local.storageDir' ) ) ) {
56
- throw new Error ( `Please create dir ${ _ . get ( config , 'local.storageDir' ) } ` ) ;
56
+ var dir = _ . get ( config , 'local.storageDir' ) ;
57
+ throw new Error ( `Please create dir ${ dir } ` ) ;
57
58
}
58
59
app . use ( _ . get ( config , 'local.public' , '/download' ) , express . static ( _ . get ( config , 'local.storageDir' ) ) ) ;
59
60
}
0 commit comments