mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
完善设置
This commit is contained in:
1 parent
fc0d9873a2
commit
7edb29d7b8
43 files changed
+219
-184
No files matched your search
@@ -1,7 +1,8 @@
|
||||
const { EventEmitter } = require('events');
|
||||
|
||||
const bus = new EventEmitter();
|
||||
module.exports = {
|
||||
|
||||
global.Hydro.service.bus = module.exports = {
|
||||
subscribe(events, handler) {
|
||||
for (const event of events) bus.on(event, handler);
|
||||
},
|
||||
|
||||
@@ -2,4 +2,5 @@ const { GridFSBucket } = require('mongodb');
|
||||
const db = require('./db');
|
||||
|
||||
if (!db.s) db.s = {};
|
||||
module.exports = new GridFSBucket(db);
|
||||
|
||||
global.Hydro.service.gridfs = module.exports = new GridFSBucket(db);
|
||||
Reference in new issue
Block a user