{"size": 434, "ext": "js", "max_stars_repo_path": "server.js", "max_stars_repo_name": "jayli3n/nodejs-server-for-http-requests", "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": "jayli3n/nodejs-server-for-http-requests", "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": "jayli3n/nodejs-server-for-http-requests", "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.125, "max_line_length": 73, "alphanum_fraction": 0.668202765}
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const { handleRequest } = require('./handleRequest');


// Initialize express.
const app = express();
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => console.log('Server is running on port: ', PORT));
app.use(bodyParser.json());
app.use(cors());

// Routes.
app.all('/', (req, res) => handleRequest(req, res));
