yep
This commit is contained in:
parent
4f6d7cfe60
commit
8fa8d04427
10 changed files with 231 additions and 71 deletions
8
main.go
8
main.go
|
|
@ -23,6 +23,7 @@ type App struct {
|
|||
auth *Auth
|
||||
templates *template.Template
|
||||
storageDir string
|
||||
devMode bool
|
||||
}
|
||||
|
||||
type Skill struct {
|
||||
|
|
@ -83,11 +84,15 @@ func main() {
|
|||
auth: auth,
|
||||
templates: tmpl,
|
||||
storageDir: cfg.StorageDir,
|
||||
devMode: cfg.DevMode,
|
||||
}
|
||||
app.auth.WithDB(db)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
|
||||
mux.HandleFunc("/auth/login", app.auth.HandleLogin)
|
||||
mux.HandleFunc("/auth/callback", app.auth.HandleCallback)
|
||||
mux.HandleFunc("/auth/logout", app.auth.HandleLogout)
|
||||
mux.Handle("/uploads/", app.auth.RequireAuth(http.HandlerFunc(app.handleDownload)))
|
||||
mux.HandleFunc("/", app.handleHome)
|
||||
mux.Handle("/dashboard", app.auth.RequireAuth(http.HandlerFunc(app.handleDashboard)))
|
||||
|
|
@ -133,7 +138,8 @@ func (a *App) handleHome(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
a.render(w, "home.html", map[string]any{
|
||||
"Title": "LLM Skill Marketplace",
|
||||
"Title": "LLM Skill Marketplace",
|
||||
"DevMode": a.devMode,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue