go-zero icon indicating copy to clipboard operation
go-zero copied to clipboard

feat: add Serve(w, r) to support serverless services like vercel

Open kevwan opened this issue 5 months ago • 4 comments
trafficstars

fix #4892

also, we need to avoid the problem mentioned in #4639

see also https://vercel.com/docs/functions/runtimes/go

kevwan avatar May 25 '25 08:05 kevwan

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:

... and 20 files with indirect coverage changes

: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.

codecov[bot] avatar May 25 '25 13:05 codecov[bot]

image You should bind routes to router. also, need to avoid the problem mentioned in https://github.com/zeromicro/go-zero/issues/4639

jaronnie avatar May 26 '25 01:05 jaronnie

ng.withTimeout() is not applied when using server.ServeHTTP()

image

Can you expose this method so that we can use it on our own http.Server? image

fondoger avatar May 29 '25 11:05 fondoger

Add my implementation proposal: https://github.com/zeromicro/go-zero/pull/4909

fondoger avatar May 29 '25 12:05 fondoger

Duplicate of #5001

kevwan avatar Jul 12 '25 15:07 kevwan