feat: serve the student app from the plugin
This commit is contained in:
@@ -34,6 +34,15 @@ func (p *Plugin) Routes(r pact.Router) error {
|
||||
g.Get("/materials/{id}", h.Material)
|
||||
g.Where("id", "[0-9]+")
|
||||
})
|
||||
// The student app: the least specific pattern, so every route above and
|
||||
// the admin's keep precedence. It also answers (404) the reserved paths.
|
||||
static, err := newStaticHandler(p.app, p.publicFS)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.GroupRaw("", nil, func(g pact.Router) {
|
||||
g.Get("/{path...}", static.ServeHTTP)
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user