Last active
November 1, 2018 03:49
-
-
Save SamanShafigh/a6c0e81a637fd066ab607dacfb3a605f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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