aboutsummaryrefslogtreecommitdiffstats
path: root/api/mux.go
blob: 90e0ec7dd094d5932e6497b5d6bd95ede3b1667e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}