Hacker News new | ask | show | jobs
by davidjohnstone 1467 days ago
You put square brackets around parameters. e.g., routes/greet/[name].tsx

https://fresh.deno.dev/docs/getting-started/dynamic-routes

1 comments

To add on this: Looks like you can do that for directories as well. Here's how it works: https://github.com/lucacasonato/fresh/blob/4bb07f4bcebfc2056...

So the example above could be:

  user/[username]/page/[pagename].ts
Hmmm. I suspect there is some software out there that doesn't like directory names with square brackets in them.