go-zero
go-zero copied to clipboard
feat: add Serve(w, r) to support serverless services like vercel
fix #4892
also, we need to avoid the problem mentioned in #4639
see also https://vercel.com/docs/functions/runtimes/go
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.86%. Comparing base (
8690859) to head (ff5bb21). Report is 376 commits behind head on master.
Additional details and impacted files
| Files with missing lines | Coverage Δ | |
|---|---|---|
| rest/server.go | 96.93% <100.00%> (+0.40%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
You should bind routes to router. also, need to avoid the problem mentioned in https://github.com/zeromicro/go-zero/issues/4639
ng.withTimeout() is not applied when using server.ServeHTTP()
Can you expose this method so that we can use it on our own http.Server?
Add my implementation proposal: https://github.com/zeromicro/go-zero/pull/4909
Duplicate of #5001