zigzap / zap

blazingly fast backends in zig
MIT License
1.98k stars 71 forks source link

Represent request method as enum instead of string #67

Closed hauleth closed 5 months ago

hauleth commented 5 months ago

With enumerable it makes it way easier to setup routing or in general match against request method. There is even built in std.http.Method enum that provides set of such methods available.

egoholic commented 5 months ago

I'm not sure if it makes sense because in a request a method is represented as a string and you need anyway to compare against string. For example, Golang's net/http package also defines methods as strings https://pkg.go.dev/net/http#pkg-constants