BUCServer.js 515 B

123456789101112131415161718192021222324
  1. let instance = null;
  2. //singleton
  3. class BUCServer {
  4. constructor(config) {
  5. if (!instance) {
  6. this.config = Object.assign({}, config);
  7. this.config.tempDownloadDir = `${config.tempDir}/download`;
  8. fs.ensureDirSync(this.config.tempDownloadDir);
  9. this.down = new FileDownloader(config.maxUploadFileSize);
  10. instance = this;
  11. }
  12. return instance;
  13. }
  14. async main() {
  15. }
  16. }
  17. module.exports = BUCServer;