17 lines
258 B
Go
17 lines
258 B
Go
|
package api
|
||
|
|
||
|
import (
|
||
|
"github.com/go-chi/chi"
|
||
|
"github.com/go-chi/render"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
func Start() error {
|
||
|
r := chi.NewRouter()
|
||
|
|
||
|
r.Use(render.SetContentType(render.ContentTypeJSON))
|
||
|
|
||
|
r.Get("/hosts", hostsGet)
|
||
|
|
||
|
return http.ListenAndServe(":8080", r)
|
||
|
}
|