LoginSignup
0
0

webページのルーティングサンプル

Last updated at Posted at 2024-02-15

URLは基本的により左にある階層で大まかなジャンルを表し、右側で具体的な内容・同紙などを表す

  • /
  • /content
  • /content/create
  • /content/<id>
  • /content/<id>/result
  • /content/<id>/run
  • /login
  • /user
  • /user/create

可変パス

  • /user/<user_id>
    • /user/userA
  • /user/<user_id>/profile
    • /user/userA/profile
  • /content/<token>
    • /content/77uaaz8fPwVzFD8aPyxGPzIaPx15PwhGPz8vOT9faz9vDQob

bad route

  1. /<uid>
  2. /profile

/profileにアクセスした際に1番へルーティングされてしまうことがあるため良くない

余談

知り合いに教える機会があったため書いてみました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0