19 lines
354 B
Go
19 lines
354 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
"scrap/api/article"
|
|
|
|
"github.com/go-chi/chi"
|
|
)
|
|
|
|
func Setup() {
|
|
r := chi.NewRouter()
|
|
|
|
r.Get("/articles", article.ArticleQueryHandler)
|
|
r.Get("/articles-download", article.ArticleDownloadHandler)
|
|
r.Handle("/tiles/", http.StripPrefix("/tiles/", http.FileServer(http.Dir("tiles"))))
|
|
|
|
http.ListenAndServe(":8080", r)
|
|
}
|