summaryrefslogtreecommitdiff
path: root/system/api/server.go
blob: e2af125c61d2c6a4c9d651ba7adc387a6071a8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package api

import (
	"fmt"
	"net/http"
)

// Run adds Handlers to default http listener for API
func Run() {
	http.HandleFunc("/api/types", Record(CORS(typesHandler)))

	http.HandleFunc("/api/contents", Record(CORS(contentsHandler)))

	http.HandleFunc("/api/content", Record(CORS(contentHandler)))

	http.HandleFunc("/api/content/external", Record(CORS(externalContentHandler)))

	fmt.Println("API routes registered.")
}