-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
schematic works nicely when creating a client.
I think it might be cool to consider generating code for the server too.
The bare minimum would be generating the response structs to serialize responses.
A more ambitious goal would be to generate the main boilerplate to serve the HTTP API: http handlers, helpers to parse requests and render responses, etc.
Maybe even doing something like this:
package main
import (
"http"
"github.com/whatever/api/server"
)
func main() {
// NewHandler takes an object that implements server.Handler and returns an http.Handler
// server.Handler is generated by schematic and it has one method for each link in the Schema
h := server.NewHandler(backend{})
s := &http.Server{Addr: ":8080", Handler: h}
s.ListenAndServe()
}Metadata
Metadata
Assignees
Labels
No labels