feat: expose InitServer
I'm working on some cloud functions that I'd like to write unit-tests for where the unit-test spins up the cloud function locally and makes some HTTP requests against it.
I would use funcframework.Start for this, but there's no way to shut down the server once it's started, so the tests conflict with one another on the port, and the goroutines used to start the servers stay running until the test process exits.
A simple way to fix this is to be able to pass a context into funcframework.Start so I can cancel the context when I'm done with the server. That's what this PR is for.
For reverse-compatibility reasons, I added a new function named StartContext rather than modifying the Start function.
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!
-- conventional-commit-lint bot https://conventionalcommits.org/
After trying to rebase this on the most recent changes from master, I think I'm going to abandon this.
It's a little more clear to me that the framework.go code is not necessarily the best place to modify to get what I need.
Thanks for reviewing!