diff options
Diffstat (limited to 'system/api/server.go')
-rw-r--r-- | system/api/server.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/system/api/server.go b/system/api/server.go index 5fa0bfc..5de10a2 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -10,7 +10,8 @@ import ( "github.com/nilslice/cms/system/db" ) -func init() { +// Run adds Handlers to default http listener for API +func Run() { http.HandleFunc("/api/types", func(res http.ResponseWriter, req *http.Request) { var types = []string{} for t := range content.Types { @@ -128,8 +129,3 @@ func wrapJSON(json []byte) []byte { return buf.Bytes() } - -// Run start the JSON API -func Run(port string) { - log.Fatal(http.ListenAndServe(":"+port, nil)) -} |