{"size": 759, "ext": "js", "max_stars_repo_path": "index.js", "max_stars_repo_name": "Paikz/scenery_server", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "index.js", "max_issues_repo_name": "Paikz/scenery_server", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "index.js", "max_forks_repo_name": "Paikz/scenery_server", "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": 26.1724137931, "max_line_length": 78, "alphanum_fraction": 0.7009222661}
#!/usr/bin/env node
"use strict";

var http = require('http');
var mongoose = require('mongoose');
var app = require('./bin/app');
var socket = require('./websocket/socket');
var server = http.createServer(app);
var socketServer = socket(server);
mongoose.Promise = global.Promise;

//Mongoose
const dsn =  process.env.DBWEBB_DSN || "mongodb://localhost:27017/test";
mongoose.connect(dsn, { useMongoClient: true });
var db = mongoose.connection;

db.on('error', console.error.bind(console, 'connection error with mongodb:'));

db.once('open', function() {
  console.log("Connected to mongodb.")
});

// Start up server
console.log("Express is ready.");
const port = process.env.PORT || '3000';

server.listen(port);
console.log("Listening on port: " + port);
