From 49ffc60afbdb96df7057bbf2236b743713f374d0 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 3 Mar 2020 16:47:15 +0000 Subject: [PATCH] Use Foo.Call on /foo (#1286) Co-authored-by: Jake Sanders --- api/resolver/micro/route.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/resolver/micro/route.go b/api/resolver/micro/route.go index 96b128c8..b2f94b01 100644 --- a/api/resolver/micro/route.go +++ b/api/resolver/micro/route.go @@ -18,6 +18,11 @@ func apiRoute(p string) (string, string) { p = strings.TrimPrefix(p, "/") parts := strings.Split(p, "/") + // if we have 1 part assume name Name.Call + if len(parts) == 1 && len(parts[0]) > 0 { + return parts[0], methodName(append(parts, "Call")) + } + // If we've got two or less parts // Use first part as service // Use all parts as method