{"size": 706, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "basimsahaf/RESTFful-Web-Services", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server.js", "max_issues_repo_name": "basimsahaf/RESTFful-Web-Services", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server.js", "max_forks_repo_name": "basimsahaf/RESTFful-Web-Services", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.0625, "max_line_length": 61, "alphanum_fraction": 0.678470255}
//server.js

//Importing Express framework
const express = require('express');

//Importing our database Client to interact with our database
const MongoClient = require('mongodb').MongoClient;

//Importing bodyParser
const bodyParser = require('body-parser');

//connecting to our database

const db = require('./config/db');

const app = express(); //declaring an express instance.

//specifying port

const port = 8000;

app.use(bodyParser.urlencoded({ extended: true }));

MongoClient.connect(db.url, (err, database) => {
    if (err) return console.log(err)
    require('./app/routes')(app, database);
    app.listen(port, () => {
        console.log('We are now live on ' + port + '. ');
    });
})

