2023-01-02 10:50:37 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
2023-08-09 15:03:27 +00:00
|
|
|
"git.rpjosh.de/ncDocConverter/internal/api"
|
2023-01-02 10:50:37 +00:00
|
|
|
"github.com/go-chi/chi/v5"
|
|
|
|
"github.com/go-chi/chi/v5/middleware"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (app *WebApplication) routes() http.Handler {
|
|
|
|
api := api.Api{Logger: app.logger, Config: app.config}
|
|
|
|
|
|
|
|
router := chi.NewRouter()
|
|
|
|
router.Use(middleware.RealIP, app.recoverPanic, app.logRequest, secureHeaders)
|
|
|
|
|
|
|
|
api.SetupServer(router)
|
|
|
|
|
|
|
|
return router
|
|
|
|
}
|