dataBaseRouter.js 638 B

12345678910111213141516171819202122
  1. const express = require("express");
  2. const {
  3. indexDataBase,
  4. searchDataBase,
  5. postSearchDataBase,
  6. showHards,
  7. showDistros,
  8. showErrors,
  9. } = require("../Controllers/dataBaseController");
  10. const dataBaseRouter = express.Router();
  11. const urlencodedParser = express.urlencoded({ extended: false });
  12. dataBaseRouter.get("/", indexDataBase);
  13. dataBaseRouter.get("/search", searchDataBase);
  14. dataBaseRouter.get("/hards", showHards);
  15. dataBaseRouter.get("/distros", showDistros);
  16. dataBaseRouter.get("/errors", showErrors);
  17. dataBaseRouter.post("/search", urlencodedParser, postSearchDataBase);
  18. module.exports = { dataBaseRouter };