Skip to content

Instantly share code, notes, and snippets.

@pierr
Last active October 15, 2015 14:27
Show Gist options
  • Save pierr/86159b709242ea96c71c to your computer and use it in GitHub Desktop.
Save pierr/86159b709242ea96c71c to your computer and use it in GitHub Desktop.
Routes

Règle de nommage des routes

  • On met le nom de l'entité au pluriel.
  • On ne termine pas une route par /
  • Les actions sur une entité sont suffixé par ()
  • Les paramètres de tri et de pagination sont des paramètres d'URL
Element Action format verbe exemple
Liste Chargement /entities GET /commandes
Recherche Chargement /entities POST /commandes?order=desc
Entité portant le sujet Chargement /entities/:id GET /commandes/123
Partie d'une entité Chargement /entities/:id/sub-enitity-detail GET /commandes/123/address
Liste d'une entité Chargement /entities/:id/sub-enitites GET /commandes/123/transaction-lines
Element d'une liste d'entite Chargement /entities/:id/sub-enitites/:sid GET /commandes/123/transaction-lines/998
Création d'une entité Création /entities POST /commandes
Mise à jour d'une entité Update /entities/:id PUT /commandes/123
Suppression d'une entité Suppression /entities/:id DELETE /commandes/123
Action sur une entité Action /entities/:id/action() POST /commandes/123/export()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment