ire4ever1190 / mike

The new and improved mikero web framework
35 stars 1 forks source link

Allow aliasing parameters for better reusability #18

Closed ire4ever1190 closed 1 year ago

ire4ever1190 commented 1 year ago

Can now use CtxParam to alias a name + type

e.g.

type
  AuthHeader = CtxParam["Authorization", Header[string]]

Now AuthHeader can be used and it will automatically use "Authorization" as the name

e.g.

# No need to do {.name: "Authorization".} since it already knows thats its name
"/secrets" -> get(auth: AuthHeader):
  # stuff