Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //chce sobie zrobic taki endpoint
  2. //GET /api/user/:userId/messages/:messageId
  3.  
  4. //No i teraz jak mam to podzielić jeśli chodzi o strukturę plików?
  5.  
  6. //Bo kurde myślałem, że sobie zrobię katalogi tak:
  7. // /user
  8. // /user/index.js
  9.  
  10. // /user/messages/index.js
  11.  
  12. // ale mi psuje ten :userId, bo nie da się zrobić czegoś takiego:
  13. router.use("/users/:userId/messages", require("./messages/index.js"));
  14. // przez to :userId wlasnie :/ A gdyby to nie było zmienną to by mi śmigało, no ale mnie to nie ratuje :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement