Skip to content

Commit

Permalink
Resolved environment issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Nandan Grover committed Jul 9, 2020
1 parent ce7cbdf commit 60da4f1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 213 deletions.
Binary file modified client/themes/themeSpartan_2/.DS_Store
Binary file not shown.
209 changes: 0 additions & 209 deletions client/themes/themeSpartan_2/index.html

This file was deleted.

8 changes: 8 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const dotenv = require('dotenv')

dotenv.config();

module.exports = {
db: process.env.DB,
users: process.env.ALLOWED_USERS,
};
5 changes: 2 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ const path = require("path");
const mongoose = require('mongoose');
const bodyParser = require("body-parser");
const dataBlob = require("./server/routes/dataBlob");
const config = require('./config');

const app = express();

app.use(bodyParser.json());

const db = 'mongodb://nandan:nandan123@ds241968.mlab.com:41968/resume';

// Allow cross origin request
// app.use(cors());

mongoose
.connect(db, {
.connect(config.db, {
useNewUrlParser: true,
useUnifiedTopology: true
})
Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"homepage": "https://github.com/nandangrover/CV#readme",
"dependencies": {
"body-parser": "^1.19.0",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"mongoose": "^5.8.11",
"nodemon": "^2.0.2"
Expand Down
3 changes: 2 additions & 1 deletion server/routes/dataBlob.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const express = require('express');
const Blob = require('../models/Blob');
const atob = require('../utility/atob');
const config = require('../../config')
const router = express.Router();

const staticId = ['AwesomeGrover', 'Nandan', 'Aditi', 'Amit', 'Neeraj', 'Yash', 'Avinash', 'Shivani', 'Sangharsh', 'Yusuf'];
const staticId = config.users.split(',').map(u => u.trim());

router.get("/getJson/:id/:theme", (req, res) => {
const id = atob(req.params.id);
Expand Down

0 comments on commit 60da4f1

Please sign in to comment.