{"size": 1132, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "hansjd/rest", "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": "hansjd/rest", "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": "hansjd/rest", "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": 27.6097560976, "max_line_length": 57, "alphanum_fraction": 0.6881625442}
// Dependencies
var express = require('express');
//var mongoose = require('mongoose');
var bodyParser = require('body-parser');
var https = require('https');
var http = require('http');
var fs = require('fs');

// MongoDB
//mongoose.connect('mongoose://localhost/rest_test');

// Key and certification
var options = {
  key: fs.readFileSync('keys/kidsy-key.pem'),
  cert: fs.readFileSync('keys/kidsy-cert.pem')
};

// Express
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

// Routes
app.use('', require('./routes/general'));
app.use('/children', require('./routes/children'));
app.use('/parents', require('./routes/parents'));
app.use('/pedagogues', require('./routes/pedagogues'));
app.use('/sleep', require('./routes/sleep'));
app.use('/meals', require('./routes/meals'));
app.use('/activities', require('./routes/activities'));

// Start server
var port = 1337;
// Create an HTTPS service identical to the HTTP service.
https.createServer(options, app).listen(1338);
http.createServer(app).listen(port);
//app.listen(port);
console.log('API is running on port ' + port);


