Hey ,
I only want to load certain slices. I set the environment variable “SLICES” to e.g.
HANAMI_SLICES="admin"
My routes.rb looks like this:
# frozen_string_literal: true
module Services
class Routes < Hanami::Routes
root { "Hello from Services" }
slice :test, at: "/test" do
scope :graphql do
use :body_parser, :json
use Services::Middlewares::Authorization
post "/api", to: "graphql.api"
end
end
slice :admin, at: "/admin" do
scope :graphql do
use :body_parser, :json
use Services::Middlewares::Authorization
post "/api", to: "graphql.api"
end
end
end
end
If a request is now made on /admin, an error occurs.
2023-11-21 07:41:07 +0100 Rack app ("POST /admin/graphql/api" - (172.30.0.1)): #<Hanami::SliceLoadError: Slice 'test' not found>
How to work around this?
Thanks!