Chat Logs

  1. skillnews12Primate 0.38: The route is the contract - https://primate.run/blog/primate-038
  2. nevetPrimate โ€” Primate 0.38: The route is the contract
  3. blue^ dreamreal fyi
  4. bot[Primate Blog] Primate 0.38: The route is the contract - https://primate.run/blog/primate-038
  5. dreamrealblue: in that post, in the first example, WHAT is the endpoint? "/"?
  6. dreamrealI like the expression of get/post/head/patch as functions in the route - that makes sense, I like that a lot. But where's the tying of the route to the endpoint? how do I see 'this route is mapped to /hello' or whatever?
  7. dreamrealI'm sure it's there, it's just not exposed in the blog and should be
  8. bluedreamreal: which example? https://primate.run/blog/primate-038#declarative-route-exports ?
  9. nevetPrimate โ€” Primate 0.38: The route is the contract
  10. blueI could add that this is `routes/index.ts`, but the tying is the general primate file-based routing
  11. dreamrealYeah. Like, okay, that first one: what's the endpoint? How would I put it at "/hello"?
  12. blueyou'd create routes/hello.ts
  13. dreamrealso it's determined from the name of the source file?
  14. blueyes. https://primate.run/docs/routing#filesystem-based-routing
  15. bluethis has been the case since primate's inception, it's not new
  16. dreamrealIf I were you, I'd point that out in this entry
  17. dreamrealsure
  18. dreamrealbut not everyone knows that
  19. dreamrealand it's the question that's going to come up
  20. blueI will grant you that and add it. however: every blog post says, "if you're new to primate, read this", and the file-system based routing is the first thing explained there
  21. blueand if you're not new to primate... well you should know that
  22. dreamrealI hear you, but I'd still include a nod to it: "```typescript\n# this might be routes/hello.ts, so the url would be http://.../hello\n```
  23. blueA route file at `routes/hello.ts` is automatically mounted at `/hello` โ€”
  24. blueno registration required. To mount to `/`, create `routes/index.ts`.
  25. bluewill add this as a note
  26. bluedone & live
  27. bluedreamreal: are you happy with the change?