@@ -40,10 +40,10 @@ app.use(express.static(path.join(__dirname, 'public')));
4040//use nginx in production
4141if ( app . get ( 'env' ) === 'development' ) {
4242 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 ( ) ;
4747 } ) ;
4848}
4949
@@ -53,7 +53,8 @@ if (_.get(config, 'common.storageType') === 'local'
5353 && _ . get ( config , 'local.storageDir' )
5454 ) {
5555 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 } ` ) ;
5758 }
5859 app . use ( _ . get ( config , 'local.public' , '/download' ) , express . static ( _ . get ( config , 'local.storageDir' ) ) ) ;
5960}
0 commit comments