Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import {MongoClient} from 'mongodb';
import UserController from './controller/user-controller';
import UserService from './service/user-service'
import MongoDriver from './service/db-service';
import Config from './service/config-service';
export const config = {
constructor: () => new Config(process.env),
tags: ['boot']
}
export const userController = {
constructor: (container) => new UserController(container.get('userService')),
}
export const userService = {
constructor: (container) => new UserService(container.get('db')),
}
export const mongoClient = {
constructor: () => MongoClient,
}
export const db = {
constructor: (container) => new MongoDriver(container.get('mongoClient'), container.get('config')),
tags: ['boot']
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment