'use strict';

require('dotenv').load();
var express = require('express');
var app = express();
var passport = require('passport');
var clc = require('cli-color');
var port = process.env.PORT || 3000;
var time = new Date();
process.env.SECRET_KEY = process.env.SECRET_KEY || 'change this change this change this!!!';

app.use(passport.initialize());

var dbRouter 		= express.Router();
var authRouter 	= express.Router();

require('./scripts/passport_strat')(passport);

require('./routes/db-routes')(dbRouter);
require('./routes/auth-routes')(authRouter, passport);


console.log(clc.magenta('process.env.SECRET_KEY ::::::::::::::  '), process.env.SECRET_KEY);

app.use(express.static(__dirname + '/'));

app.use('/', dbRouter);
app.use('/auth/', authRouter);

app.listen(port, function () {
	console.log(clc.cyanBright('server started on port ' + port + ' at ' + time));
});

@@ -12,34 +12,8 @@
 ';%0A%0A
-require('dotenv').load();%0A
 var 
@@ -191,16 +191,77 @@
 Date();%0A
+var fs = require('fs');%0Avar testEnv = fs.statSync('./.env');%0A
 process.
@@ -345,16 +345,61 @@
 is!!!';%0A
+if (testEnv) %7B%0A%09require('dotenv').load();%0A%7D%0A%0A
 %0Aapp.use
@@ -642,16 +642,19 @@
 ort);%0A%0A%0A
+// 
 console.

check if .env file exists