diff --git a/lib/hanami/router.rb b/lib/hanami/router.rb
index <HASH>..<HASH> 100644
--- a/lib/hanami/router.rb
+++ b/lib/hanami/router.rb
@@ -803,7 +803,9 @@ module Hanami
 
       if inspect?
         @inspector.add_route(
-          Route.new(http_method: http_method, path: path, to: to, as: as, constraints: constraints, blk: blk)
+          Route.new(
+            http_method: http_method, path: path, to: to || endpoint, as: as, constraints: constraints, blk: blk
+          )
         )
       end
     end
diff --git a/spec/unit/hanami/router/routing.rb b/spec/unit/hanami/router/routing.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/hanami/router/routing.rb
+++ b/spec/unit/hanami/router/routing.rb
@@ -14,5 +14,17 @@ RSpec.describe Hanami::Router do
 
       expect(router.inspector.call).to include("home#index")
     end
+
+    it "uses resolved block value to generate the route" do
+      inspector = Hanami::Router::Inspector.new
+
+      router = Hanami::Router.new(inspector: inspector) do
+        get "/" do
+          "Block"
+        end
+      end
+
+      expect(router.inspector.call).to include("(block)")
+    end
   end
 end
Fix block not given to the route when no `to` option (#<I>)