mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Add settings persistance on backend
This commit is contained in:
23
backend/internal/api/routes.go
Normal file
23
backend/internal/api/routes.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"novamd/internal/db"
|
||||
"novamd/internal/filesystem"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
func SetupRoutes(r chi.Router, db *db.DB, fs *filesystem.FileSystem) {
|
||||
r.Route("/api/v1", func(r chi.Router) {
|
||||
r.Route("/settings", func(r chi.Router) {
|
||||
r.Get("/", GetSettings(db))
|
||||
r.Post("/", UpdateSettings(db))
|
||||
})
|
||||
r.Route("/files", func(r chi.Router) {
|
||||
r.Get("/", ListFiles(fs))
|
||||
r.Get("/*", GetFileContent(fs))
|
||||
r.Post("/*", SaveFile(fs))
|
||||
r.Delete("/*", DeleteFile(fs))
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user