api copied to hudozka-api module based on express

This commit is contained in:
tmshv committed 2020-02-15 01:38:07 +03:00
1 parent 70007d3199
commit fc0724a900
21 files changed
+1093

No files matched your search

+18
View File
@@ -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)
}
}