diff --git a/backend/src/database/connection.js b/backend/src/database/connection.js index e0746c2..b3b2a2c 100644 --- a/backend/src/database/connection.js +++ b/backend/src/database/connection.js @@ -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) diff --git a/backend/src/database/db.test.sqlite b/backend/src/database/db.test.sqlite index fbd473e..d47ec84 100644 Binary files a/backend/src/database/db.test.sqlite and b/backend/src/database/db.test.sqlite differ diff --git a/package.json b/package.json index 3721cdb..0a0b8fa 100644 --- a/package.json +++ b/package.json @@ -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",