Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
It's all ok.
  • Loading branch information
Aditya-Thakur committed Jun 3, 2021
2 parents 69775f0 + 5e32bdb commit fe14fdf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var cors = require('cors')
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser')
var logger = require('./logger').createLogger('./log/development.log');
// var logger = require('logger').createLogger('./log/development.log');
const userController = require('./controllers/userController');
const surveyController = require('./controllers/surveyController');
const responseController = require('./controllers/responseController');
Expand All @@ -14,7 +14,7 @@ app.listen(port, () => {
console.log('Express server started at port: 3000');
});
app.use(cors());
logger.info('loading an array', [1,2,3], 'now!');
// logger.info('loading an array', [1,2,3], 'now!');
// app.use( function(req, res, next) {
// res.header('Access-Control-Allow-Origin', '*');
// res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
Expand All @@ -24,4 +24,4 @@ logger.info('loading an array', [1,2,3], 'now!');
app.use('/user', userController);
app.use('/survey', surveyController);
app.use('/response', responseController);
app.get('/', (req, res) => res.send('Home Page Route'));
app.get('/', (req, res) => res.send('Home Page Route'));
4 changes: 2 additions & 2 deletions models/db.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const mongoose = require('mongoose');

mongoose.connect('mongodb+srv://aditya:vercel@surveydb.lkwaz.mongodb.net/myFirstDatabase?retryWrites=true&w=majority', {useNewUrlParser: true}, (err) => {
mongoose.connect('mongodb+srv://aditya:vercel@surveydb.lkwaz.mongodb.net/surveyDB?retryWrites=true&w=majority', {useNewUrlParser: true}, (err) => {
if(!err) { console.log('MongoDB Connection Succeeded.') }
else { console.log('Error in DB Connection : '+ err)}
});

require('./user.model');
require('./survey.model');
require('./response.model');
require('./response.model');

1 comment on commit fe14fdf

@vercel
Copy link

@vercel vercel bot commented on fe14fdf Jun 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.