birdpack 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core.js +4 -0
- package/lib/server.js +4 -3
- package/package.json +1 -1
package/lib/core.js
CHANGED
|
@@ -317,6 +317,10 @@ module.exports = class{
|
|
|
317
317
|
if(fileStat !== false && fileStat.isFile()){
|
|
318
318
|
let fileExt = options.file.split('.').pop().toLowerCase();
|
|
319
319
|
|
|
320
|
+
if(fileStat.size == 0){
|
|
321
|
+
return options.error(400, 'This file is empty.');
|
|
322
|
+
}
|
|
323
|
+
|
|
320
324
|
let fileRange = 'file';
|
|
321
325
|
if(options.hasOwnProperty('type')){
|
|
322
326
|
}else if(fileType.hasOwnProperty(fileExt)){
|
package/lib/server.js
CHANGED
|
@@ -236,8 +236,9 @@ module.exports = class{
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
this.logServer('server', `The server is collecting logs via (${this.opt.log})`);
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
port = port || this.opt.port || process.env.PORT || 3000;
|
|
240
|
+
this.server.listen(port, host, ()=>{
|
|
241
|
+
this.logServer('server', `Started on server(${this.opt.use}) port(${port})`);
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
}
|
|
@@ -381,4 +382,4 @@ module.exports = class{
|
|
|
381
382
|
}
|
|
382
383
|
return ()=>{};
|
|
383
384
|
}
|
|
384
|
-
}
|
|
385
|
+
}
|