chore: Extract knex model integration to separate file
This commit is contained in:
@@ -6,15 +6,12 @@ import corsOptions from './config/cors-options';
|
||||
import graphQLInstance from './helpers/graphql-instance';
|
||||
import logger from './helpers/logger';
|
||||
import morgan from './helpers/morgan';
|
||||
import errorHandler from './helpers/error-handler'
|
||||
import { Model } from 'objection';
|
||||
import errorHandler from './helpers/error-handler';
|
||||
import './config/database';
|
||||
|
||||
const app = express();
|
||||
const port = appConfig.port;
|
||||
|
||||
import knex from './config/database';
|
||||
Model.knex(knex)
|
||||
|
||||
app.use(morgan);
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: false }));
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Model } from 'objection';
|
||||
import knexInstance from 'knex';
|
||||
import knexConfig from '../../knexfile';
|
||||
|
||||
const knex = knexInstance(knexConfig)
|
||||
|
||||
export default knex;
|
||||
Model.knex(knex)
|
||||
|
Reference in New Issue
Block a user