feat: serve the student app from the plugin

This commit is contained in:
Jakub Zych
2026-10-02 14:43:02 +02:00
parent 5106239c97
commit 21107e9804
7 changed files with 491 additions and 0 deletions

View File

@@ -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
}