-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
27 lines (22 loc) · 877 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const express = require('express');
const bodyParser = require('body-parser');
// const MongoClient = require('mongodb').MongoClient;
// const mongoose = require('mongoose');
// const db = require('./app/config/database');
const app = express();
//require route file for well structured app route
// 1.app-> instance of express 2.db -> database
require('./app/route')(app, {});
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true })); //URL encoded forms processor
//server port
let port = 8000;
// MongoClient.connect(db.url, (err, database) => {
// if (err) return console.log(err);
// Make sure you add the database name and not the collection name
// myDatabase = database.db("bot-api");
// require('./app/route')(app,myDatabase);
app.listen(process.env.PORT || 5000,()=>{
console.log("We are Live");
});
// })