4

Developers !

I need fast advice!

If i want to have a domain like instagram e.g.

domain.com/first-lastname1
domain.com/first-lastname2
domain.com/first-lastname3
...

What is the best way to define those routes? I am using only angular. Its just a landing page so no backend frameworks are needed or used.

So if i have about 50 first-last names (and i might add even a lot more), is it a good idea to create 50 different components in angular where each component links to the different person identity of those /first-lastnameN routes?

Or should i have only 1 component and loop through names from a list and display them somehow? Because i dont know how to do this way And change the URL route into a different name

Comments
  • 16
    Why is this a rant?

    There are route parameters in Angular, you can define them like "/:name", where name will be replaced with a value, and you cam access that value from the component connected to that route. So make 1 component that accepts such a parameter and display the data from somewhere in your app.
  • 6
    Seems like a lot of work to avoid just using rewrite rules.
  • 0
    Use HTML.
  • 0
    Stop right there criminal scum.
    Stop everything
    And use rust w/ actix or wathever, but use rust 😉 (or C)
  • 0
    @MagicSowap rust is really nice and I love it very much but it's not really possible to make frontend apps with it. You use it for wasm but I don't think you have access to the dom in wasm? 🤔
  • 0
    @olback Yes, you (sadly) have to use JS bindings to access the dom...
  • 2
    Is this a joke?
Add Comment