{"size": 1695, "ext": "js", "max_stars_repo_path": "DestinyManifestServer/server.js", "max_stars_repo_name": "austin183/Destinapian", "max_stars_repo_stars_event_min_datetime": "2019-11-27T03:12:14.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-27T03:12:14.000Z", "max_issues_repo_path": "DestinyManifestServer/server.js", "max_issues_repo_name": "austin183/Destinapian", "max_issues_repo_issues_event_min_datetime": "2020-09-07T08:28:15.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-02T05:37:13.000Z", "max_forks_repo_path": "DestinyManifestServer/server.js", "max_forks_repo_name": "austin183/Destinapian", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 9, "max_forks_count": null, "avg_line_length": 31.9811320755, "max_line_length": 100, "alphanum_fraction": 0.7286135693}
//bootsrapping to provide end points and json responses
console.log("Bootstrapping Express");
const swaggerUi = require('swagger-ui-express');
const swaggerJsdoc = require('swagger-jsdoc');
const logger = require('./utilities/logger').logger;
var express = require('express'),
  app = express(),
  port = process.env.PORT || 3000,
  bodyParser = require('body-parser');
  
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());

//test out logging
logger.info('Testing out logging');

//configure swagger
logger.info('Configuring Swagger');
const options = {
  swaggerDefinition: {
    // Like the one described here: https://swagger.io/specification/#infoObject
    info: {
      title: 'Destiny Manifest Server Docs',
      version: '1.0.0',
      description: 'Partially autogenerated doc and test interface for the Destiny Manifest Server',
    },
  },
  // List of files to be processes. You can also set globs './routes/*.js'
  apis: ['./api/routes/*.js'],
};

const specs = swaggerJsdoc(options);


//update manifest if necessary
logger.info("Updating Manifest");
var manifestModel = require('./api/models/manifestModel');
manifestModel.updateManifest();
var latestManifestPath = manifestModel.getLatestManifestDatabase();
logger.info('latest manifest: ' + latestManifestPath);

//register routes
logger.info("Registering routes");
var routes = require('./api/routes/manifestRoutes');
var platformRoutes = require('./api/routes/platformRoutes');
routes(app);
platformRoutes(app);
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs));

//start listening for requests
app.listen(port);

logger.info('Destiny Manifest RESTful API server started on: ' + port);