From cdb75d3fcbc9339b897f8c6ff4d69a577f017393 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Tue, 8 Jul 2025 23:26:05 +0100 Subject: Rewrite in Go --- api/mux.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 api/mux.go (limited to 'api/mux.go') diff --git a/api/mux.go b/api/mux.go new file mode 100644 index 0000000..90e0ec7 --- /dev/null +++ b/api/mux.go @@ -0,0 +1,16 @@ +package api + +import ( + "net/http" + + "github.com/LMBishop/scrapbook/api/handler" + "github.com/LMBishop/scrapbook/pkg/config" + "github.com/LMBishop/scrapbook/pkg/index" +) + +func NewMux(cfg *config.MainConfig, siteIndex *index.SiteIndex) *http.ServeMux { + mux := http.NewServeMux() + mux.HandleFunc("POST /site/{site}/upload", handler.UploadSiteVersion(cfg, siteIndex)) + + return mux +} -- cgit v1.2.3-70-g09d2