express-typeorm-rest-boilerplate
Version:
Boilerplate code to get started with building RESTful API Services
14 lines (12 loc) • 324 B
text/typescript
import Logger from '../logger';
import { Connection, createConnection, useContainer } from 'typeorm';
import { Container } from 'typedi';
export default async (): Promise<Connection> => {
useContainer(Container);
try {
return await createConnection();
} catch (err) {
Logger.debug(err);
throw err;
}
};