Adding dotenv to app.js to enable running in dev environment
This commit is contained in:
parent
b64126a7fe
commit
b5b49c5424
@ -1,5 +1,7 @@
|
||||
// Initialize project
|
||||
const db = require('./db/db')
|
||||
const path = require('path')
|
||||
require('dotenv').config({path: path.join(__dirname, '../.env')})
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
|
||||
@ -79,5 +81,6 @@ app.get('/cleanup', (req, res) => {
|
||||
|
||||
// listen for requests :)
|
||||
const listener = app.listen(process.env.PORT || 4200, function() {
|
||||
console.log(process.env.DB_USER)
|
||||
console.log("Your app is listening on port " + listener.address().port);
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
const db = require('../db/db')
|
||||
const request = require('request')
|
||||
const path = require('path')
|
||||
const dotenv = require('dotenv').config({path: path.join(__dirname, '../../.env')})
|
||||
require('dotenv').config({path: path.join(__dirname, '../../.env')})
|
||||
|
||||
// The URL from which to export production data
|
||||
const url = 'https://jasonsplant.glitch.me/exportall'
|
||||
|
Loading…
Reference in New Issue
Block a user