May 15, 2021 Revel
How to put an existing http. Handlers integrated into Revel?
In the concept map, http. H andler is used to process user requests. Revel's processing is very simple, it simply creates a controller instance and passes the request to the filter chain.
Applications can consolidate existing https by overrideing the default handler. Handlers:
func installHandlers() {
var (
serveMux = http.NewServeMux()
revelHandler = revel.Server.Handler
)
serveMux.Handle("/", revelHandler)
serveMux.Handle("/path", myHandler)
revel.Server.Handler = serveMux
}
func init() {
revel.OnAppStart(installHandlers)
}
What is the relationship between interceptors, filters, and modules?
A module is a package that can be inserted into a program. They can share controllers, views, resources, and other code across multiple Level programs (or third-party sources).
A filter is a function that can be hooked up to a request to process a pipeline. They are generally used as a whole processing technique in applications to vertically separate application logic.