Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
require('dotenv').config({ path: './config/.env'});
require('colors');
require('dotenv').config({
path: './config/.env'
});
// require('colors');

const server = require('./routes/api/server.js');

const PORT = process.env.PORT || 3300;

server.listen(PORT, () => console.log(`
\n*** Server running in ${process.env.NODE_ENV} mode on port ${PORT} ***\n
`.blue.bold));
`));
15 changes: 9 additions & 6 deletions knexfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ module.exports = {
development: {
client: 'pg',
connection: 'postgresql://localhost/dev-sorting-hat',
ssl: {
rejectUnauthorized: false
}, // this is for heroku
pool: {
min: 2,
max: 10
Expand All @@ -14,10 +17,10 @@ module.exports = {
tableName: 'knex_migrations'
},
seeds: {
directory:'./database/seeds'
directory: './database/seeds'
}
},

staging: {
client: 'pg',
connection: process.env.DATABASE_URL || 'postgresql://localhost/staging-sorting-hat',
Expand All @@ -30,10 +33,10 @@ module.exports = {
tableName: 'knex_migrations'
},
seeds: {
directory:'./database/seeds'
directory: './database/seeds'
}
},

production: {
client: 'pg',
connection: process.env.DATABASE_URL,
Expand All @@ -46,8 +49,8 @@ module.exports = {
tableName: 'knex_migrations'
},
seeds: {
directory:'./database/seeds'
directory: './database/seeds'
}
}

};
};
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@
},
"dependencies": {
"bcryptjs": "^2.4.3",
"colors": "^1.4.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"helmet": "^3.21.3",
"jsonwebtoken": "^8.5.1",
"knex": "^0.20.10",
"knex": "^0.21.1",
"knex-cleaner": "^1.3.0",
"pg": "^7.18.2"
"pg": "^8.0.3"
}
}
Loading