-
Notifications
You must be signed in to change notification settings - Fork 495
[Go] production server #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@pavelgj WDYT of the API here?
I know the names don't quite align; do you have suggestions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to do much more than rename some things. Not clear on what is happening here.
go/genkit/servers.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this copyright message doing down here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
I tried to do a poor person's CL stack by making two separate commits. It took the message from the first instead of the second. I edited the top comment. I meant to suggest reviewing the commits separately. |
go/genkit/servers.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the idea is that StartProdServer
should always start (regardless of currentEnvironment()
), even in dev mode. Dev (reflection API) server should only run in dev mode.
So the logic here should be:
if currentEnvironment() == EnvironmentDev {
StartDevServer(addr)
}
StartProdServer(addr)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. I was going about this wrong.
I removed StartServer and changed StartProdServer to StartFlowServer.
When you call StartFlowServer, you'll get a dev server too.
This commit renames dev_server* to servers*.
Implement NewFlowServeMux, which returns an http.ServeMux that has a route for each defined flow. Provide convenience functions for using that ServeMux as a server, and also for selecting which server to use based on the current development environment.
Implement NewFlowServeMux, which returns an http.ServeMux
that has a route for each defined flow.
Provide convenience functions for using that ServeMux as a server,
and also for selecting which server to use based on the current
development environment.