Dynamic Namespace

This commit is contained in:
Ben Toogood
2020-04-09 11:03:33 +01:00
parent 27eb7db1c2
commit 4ff959ef50
5 changed files with 31 additions and 9 deletions

View File

@@ -18,8 +18,10 @@ func (r *Resolver) Resolve(req *http.Request) (*resolver.Endpoint, error) {
}
parts := strings.Split(req.URL.Path[1:], "/")
ns := r.opts.Namespace(req)
return &resolver.Endpoint{
Name: r.opts.Namespace + "." + parts[0],
Name: ns + "." + parts[0],
Host: req.Host,
Method: req.Method,
Path: req.URL.Path,