Skip to content

Latest commit

 

History

History
27 lines (24 loc) · 802 Bytes

README.md

File metadata and controls

27 lines (24 loc) · 802 Bytes

Route

You can learn about how to use hertz route:

  • static route
  • route group
  • use middleware with route group
  • parameter route
  • use anonymous function or decorator to register routes
  • route info

parameter route:

Parameters such as ':name' are called named parameters, and named parameters only match a single path segment

Pattern: /hertz/:version

 /hertz/v0                  match
 /hertz/v1                  match
 /hertz/v1/profile          no match
 /hertz/                    no match

Parameters such as '*action' are called wildcard parameters and they match everything. Therefore, they must be located at the end of the pattern

Pattern: /src/*filepath

 /src/                     match
 /src/somefile.go          match
 /src/subdir/somefile.go   match