{"size": 787, "ext": "js", "max_stars_repo_path": "src/api/index.js", "max_stars_repo_name": "chrisriesgo/conference-badge-service", "max_stars_repo_stars_event_min_datetime": "2020-04-17T18:13:11.000Z", "max_stars_repo_stars_event_max_datetime": "2020-04-17T18:13:11.000Z", "max_issues_repo_path": "src/api/index.js", "max_issues_repo_name": "chrisriesgo/conference-badge-service", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/api/index.js", "max_forks_repo_name": "chrisriesgo/conference-badge-service", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.1379310345, "max_line_length": 69, "alphanum_fraction": 0.6404066074}
import express from "express";
import path from "path";
import logger from "morgan";
import cookieParser from "cookie-parser";
import bodyParser from "body-parser";

import index from "./routes/index";
import badges from "./routes/badges";

export default ( app ) => {
    const server = express();

    const port = app.config.server.port;

    server.use( logger( "dev" ) );
    server.use( bodyParser.json() );
    server.use( bodyParser.urlencoded( { extended: false } ) );
    server.use( cookieParser());
    server.use( express.static( path.join( __dirname, "public" ) ) );

    server.use( "/", index );
    server.use( "/badges", badges( app.broker ) );

    server.listen( port, () => {
        console.log(`Example app listening on port ${port}!`)
    })

    return server;
}