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
5 changes: 5 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MYSQL_HOST=66.29.141.36
MYSQL_PORT=3306
MYSQL_USERNAME=
MYSQL_PASSWORD=#lkna
MYSQL_DBNAME=database
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ typings/
.yarn-integrity

# dotenv environment variables file
.env
.env.production
.env.test

# parcel-bundler cache (https://parceljs.org/)
Expand Down
13 changes: 12 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@ app.use(cors());
const bodyParser = require('body-parser');
app.use(bodyParser.json());

require('dotenv').config();
const path = require('path');
require('dotenv').config({
path: path.join(__dirname, `.env.${process.env.NODE_ENV}`),
});

const db = require('./utils/db');

db.connect()
.then(() => {
console.log('Database connected!');
})
.catch(console.log);

app.get('/', (req, res, next) => {
res.send('Hello world');
Expand Down
Loading