Skip to content

Commit

Permalink
add mongoose and db setup
Browse files Browse the repository at this point in the history
  • Loading branch information
AdithyakrishnaV committed Jun 30, 2021
1 parent 8261cb8 commit a8e9eff
Show file tree
Hide file tree
Showing 733 changed files with 197,575 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
require("dotenv").config();

//Framework
const { json } = require("express");
const express = require("express");
const mongoose = require("mongoose");

//Database
const database = require("./database");
Expand All @@ -10,6 +14,17 @@ const booky = express();
//Configuration
booky.use(express.json());

//Establish database connection
mongoose.connect(
process.env.MONGO_URL,
{
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,
useCreateIndex: true
}
).then(() => console.log("Connection established..!!"));

/*
Route /
Discription Get all books
Expand Down
21 changes: 21 additions & 0 deletions node_modules/@types/bson/LICENSE

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

16 changes: 16 additions & 0 deletions node_modules/@types/bson/README.md

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

Loading

0 comments on commit a8e9eff

Please sign in to comment.