// Routes returns post router with each endpoint.
Routes returns post router with each endpoint.
// Routes returns post router with each endpoint .
func (pr *PostRouter) Routes() http.Handler {
	r := chi.NewRouter()
	r.Use(middleware.Authorizator)
	r.Get("/user/{userId}", pr.GetByUserHandler)
	r.Get("/", pr.GetAllHandler)
	r.Post("/", pr.CreateHandler)
	r.Get("/{id}", pr.GetOneHandler)
	r.Put("/{id}", pr.UpdateHandler)
	r.Delete("/{id}", pr.DeleteHandler)
	return r
}
func ( pr * PostRouter ) Routes ( ) http . Handler { r := chi . NewRouter ( ) r . Use ( middleware . Authorizator ) r . Get ( " " , pr . GetByUserHandler ) r . Get ( " " , pr . GetAllHandler ) r . Post ( " " , pr . CreateHandler ) r . Get ( " " , pr . GetOneHandler ) r . Put ( " " , pr . UpdateHandler ) r . Delete ( " " , pr . DeleteHandler ) return r }
Routes returns post router with each endpoint.
Routes returns post router with each endpoint .