Files
PixivFE/doc/dev/framework-migration.md
T
2024-08-28 13:39:15 +00:00

17 lines
527 B
Markdown

# Migrating from gofiber to net/http -- the plan
## Tips
- To access `/:abc`, use `r.PathValue("abc")`.
- Want to associate arbitrary value with a request? Use `r.Context.Value()`.
- Don't use `r.Response`. It's `nil`.
- Only use the following HTTP status codes:
- 303 StatusSeeOther: set method to GET
- 307 StatusTemporaryRedirect: method and body not changed
- 308 StatusPermanentRedirect: method and body not changed
## todo
- add limiter (maybe it should be in nginx)
- add caching (maybe it should be in nginx)