api copied to hudozka-api module based on express
This commit is contained in:
1 parent
70007d3199
commit
fc0724a900
21 files changed
+1093
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { Collection } from 'mongodb'
|
||||
import * as db from '../db'
|
||||
|
||||
const store = new Map<string, Collection>()
|
||||
|
||||
export default class Data {
|
||||
static setStore(key: string, collection: Collection) {
|
||||
store.set(key, collection)
|
||||
}
|
||||
|
||||
static getStore<T>(key: string): Collection<T> {
|
||||
return store.get(key)
|
||||
}
|
||||
|
||||
static getCollection(name: string): Collection {
|
||||
return db.collection(name)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user