{"size": 483, "ext": "js", "max_stars_repo_path": "src/app.js", "max_stars_repo_name": "Phunmbi/Population-Management-System", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/app.js", "max_issues_repo_name": "Phunmbi/Population-Management-System", "max_issues_repo_issues_event_min_datetime": "2020-09-06T16:45:25.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-01T19:50:33.000Z", "max_forks_repo_path": "src/app.js", "max_forks_repo_name": "Phunmbi/Population-Management-System", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 20.125, "max_line_length": 55, "alphanum_fraction": 0.6790890269}
import express from 'express';
import cors from'cors';
import routes from './modules/index';

// Create a new instance of express
const app = express();

// setup express middleware
app.use(express.json());
app.use(express.urlencoded({ extended:false }));
app.use(cors());

// plug routes into app
routes(app);

// handle unregistered routes
app.use('*', (req, res) => {
  res.status(404).json({
    message: 'Not Found. Use /api/v1 to access the Api'
  });
});

export default app;
