{"size": 666, "ext": "js", "max_stars_repo_path": "routes/api.js", "max_stars_repo_name": "TALLuff/BEND_nc-news", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes/api.js", "max_issues_repo_name": "TALLuff/BEND_nc-news", "max_issues_repo_issues_event_min_datetime": "2021-05-08T14:21:29.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T14:21:29.000Z", "max_forks_repo_path": "routes/api.js", "max_forks_repo_name": "TALLuff/BEND_nc-news", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 30.2727272727, "max_line_length": 65, "alphanum_fraction": 0.7102102102}
const apiRouter = require("express").Router();
const { methodNotAllowed, routeNotFound } = require("../errors");
const articlesRouter = require("./articles");
const commentsRouter = require("./comments");
const topicsRouter = require("./topics");
const usersRouter = require("./users");
const { endpoints } = require("../endpoints");

apiRouter
  .route("/")
  .get((req, res) => res.send(endpoints))
  .all(methodNotAllowed);

apiRouter.use("/articles", articlesRouter);
apiRouter.use("/comments", commentsRouter);
apiRouter.use("/topics", topicsRouter);
apiRouter.use("/users", usersRouter);

apiRouter.route("/*").all(routeNotFound);

module.exports = apiRouter;
