Skip to content

Commit

Permalink
make it better
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo S. de Paula committed Mar 29, 2020
1 parent db9b207 commit 71c44c3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion backend/src/database/connection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const knex = require('knex')
const configuration = require('../../knexfile')

const config = process.env.NODE_ENV == "test" ? configuration.test : configuration.development
let config = configuration.development

if(process.env.NODE_ENV == "production") {
config = configuration.production
} else if (process.env.NODE_ENV == "test") {
config = configuration.test
}

const connection = knex(config)

Expand Down
Binary file modified backend/src/database/db.test.sqlite
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"sqlite3": "^4.1.1"
},
"scripts": {
"start": "node backend/src/server.js"
"start": "cross-env NODE_ENV=production knex migrate:latest"
},
"devDependencies": {
"nodemon": "^2.0.2",
Expand Down

0 comments on commit 71c44c3

Please sign in to comment.