forked from ask1811/H-oracle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6ed2a6
commit df227d9
Showing
13 changed files
with
3,437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const MONGO_DB_CONFIG = { | ||
DB: "mongodb://localhost:27017/horacletest", | ||
PAGE_SIZE:10, | ||
}; | ||
|
||
module.exports = { | ||
MONGO_DB_CONFIG | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const express = require('express'); | ||
const app = express(); | ||
const mongoose = require("mongoose"); | ||
const { MONGO_DB_CONFIG } = require("./config/app.config"); | ||
require("dotenv").config(); | ||
const cors=require('cors'); | ||
const port = process.env.PORT; | ||
const bodyParser = require("body-parser"); | ||
app.use(bodyParser.json()); | ||
app.use(cors()); | ||
//const swaggerUi = require("swagger-ui-express"), swaggerDocument = require("./swagger.json"); | ||
|
||
mongoose.connect(MONGO_DB_CONFIG.DB,{ | ||
useNewUrlParser:true, | ||
useUnifiedTopology:true, | ||
}) | ||
.then( | ||
()=>{ | ||
console.log("Database connected"); | ||
}, | ||
(error)=>{ | ||
console.log("Database not connected"+error); | ||
} | ||
); | ||
|
||
app.use(express.json()); | ||
app.use("/api/auth",require("./routes/auth.routes")); | ||
app.use("/api/heart",require("./routes/heart.routes")); | ||
|
||
app.listen(process.env.port || 4000, ()=>{ | ||
console.log("Server running") | ||
}) |
Oops, something went wrong.