Generating URLs

1 min read · last updated at

This one is closely related to routing.

The lazy solution

Some frameworks don’t help you much here.

Named Routes

If your framework has a router that knows all places in your application, it makes sense to re-use it to generate links to certain pages. That way, if you decide to rename your /about page to /about-us, you don’t have to manually rename a bunch of links in potentially multiple places.

Type-Safe Routes

  • Ktorm