routes.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. const controller = require("./controller.js");
  2. const travel = require("./travel.js");
  3. module.exports = function(app){
  4. let views = `${__dirname}/views`;
  5. //MAIN
  6. app.get("/", (req, res)=>{res.sendFile(`${views}/main/index.html`)});
  7. app.get("/style", (req, res)=>{res.sendFile(`${views}/main/index.css`)});
  8. //WRITING
  9. app.get("/writing/style", (req, res)=>{res.sendFile(`${views}/writing/index.css`)});
  10. app.get("/writing/code", (req, res)=>{res.sendFile(`${views}/writing/index.js`)});
  11. app.get("/writing/comments/:article", controller.getComments);
  12. app.post("/writing/comments", controller.createComment);
  13. app.get("/writing/touchscreens", (req, res)=>{res.sendFile(`${views}/writing/touchscreens.html`)});
  14. app.get("/writing/tablets", (req, res)=>{res.sendFile(`${views}/writing/tablets.html`)});
  15. //IMAGES
  16. app.get("/images/touchscreen", (req, res)=>{res.sendFile(`${views}/images/touchscreen.jpeg`)});
  17. app.get("/images/tablet", (req, res)=>{res.sendFile(`${views}/images/tablet.jpeg`)});
  18. app.get("/images/subline", (req, res)=>{res.sendFile(`${views}/images/subline.png`)});
  19. app.get("/images/budgeteer", (req, res)=>{res.sendFile(`${views}/images/budgeteer.jpeg`)});
  20. app.get("/images/sudoku", (req, res)=>{res.sendFile(`${views}/images/sudoku.png`)});
  21. app.get("/images/birthday", (req, res)=>{res.sendFile(`${views}/images/birthday.jpg`)});
  22. app.get("/images/market", (req, res)=>{res.sendFile(`${views}/images/market.jpeg`)});
  23. //SUDOKU
  24. app.get("/sudoku", (req, res)=>{res.sendFile(`${views}/sudoku/index.html`)});
  25. app.get("/sudoku/style", (req, res)=>{res.sendFile(`${views}/sudoku/index.css`)});
  26. app.get("/sudoku/code", (req, res)=>{res.sendFile(`${views}/sudoku/index.js`)});
  27. //BIRTHDAY PARADOX
  28. app.get("/birthdayparadox", (req, res)=>{res.sendFile(`${views}/birthdayParadox/index.html`)});
  29. app.get("/birthdayparadox/style", (req, res)=>{res.sendFile(`${views}/birthdayParadox/index.css`)});
  30. app.get("/birthdayparadox/code", (req, res)=>{res.sendFile(`${views}/birthdayParadox/index.js`)});
  31. //TRAVEL
  32. app.get("/travel/style", (req, res)=>{res.sendFile(`${views}/travel/index.css`)});
  33. app.get("/travel/directories", travel.listDirectories);
  34. app.get("/travel/images/*", travel.getImages);
  35. app.get("/travel/*", (req, res)=>res.sendFile(`${views}/travel/index.html`));
  36. }