{"size": 817, "ext": "js", "max_stars_repo_path": "server/index.js", "max_stars_repo_name": "mecsoccer/property-pro-lite", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/index.js", "max_issues_repo_name": "mecsoccer/property-pro-lite", "max_issues_repo_issues_event_min_datetime": "2020-09-05T02:46:24.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-09T08:48:02.000Z", "max_forks_repo_path": "server/index.js", "max_forks_repo_name": "mecsoccer/property-pro-lite", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 25.53125, "max_line_length": 73, "alphanum_fraction": 0.6854345165}
import express from 'express';
import http from 'http';
import logger from 'morgan';
import dotenv from 'dotenv';
import cors from 'cors';
import swaggerUi from 'swagger-ui-express';
import apiRouter from './routes/index';
import swaggerDocument from '../swagger.json';

dotenv.config();

const app = express();

app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cors());

app.use('/api/v1', apiRouter);

// setup swagger doc
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerDocument));

/* istanbul ignore next */const port = process.env.PORT || '3000';
app.set('port', port);

const server = http.createServer(app);
server.listen(port, '0.0.0.0');
console.log('server listening at:', port);

export default server;
