Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #13

Closed
wants to merge 23 commits into from
Closed

Dev #13

Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
fix problems from changing to es6 imports
  • Loading branch information
Kushagra-0801 committed Feb 9, 2020
commit 0ed6cc37d63f95a22b45dc4fdaa0ab002491c5cb
8 changes: 4 additions & 4 deletions config/db.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { connect } from "mongoose";
import { get } from "config";
const mongoURI = get("mongoURI");
import mongoose from "mongoose";
import config from "config";
const mongoURI = config.get("mongoURI");

// Connects to database
const connectDB = async () => {
try {
await connect(mongoURI, {
await mongoose.connect(mongoURI, {
// Change deprecated settings to resolve warnings
useUnifiedTopology: true,
useNewUrlParser: true,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions routes/api/auth.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from "express";
const router = Router();
import express from "express";
const router = express.Router();

// @route GET api/auth
// @desc Test route
Expand Down
6 changes: 4 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import express from "express";
import connectDB from "./config/db";
import connectDB from "./config/db.js";

import auth from "./routes/api/auth.js";

const app = express();

Expand All @@ -9,7 +11,7 @@ connectDB();
app.get("/", (req, res) => res.send("API Running"));

// Define Routes
app.use("/api/auth", require("./routes/api/auth"));
app.use("/api/auth", auth);

const PORT = process.env.port || 5000;

Expand Down