title: Use /path/{proxy+} with AWS SAM to have a greedy API in API Gateway
body: <p>I'm using SAM. The following setup works:</p>
  
  <pre><code>  Function:
      Type: AWS::Serverless::Function
      Properties:
        CodeUri: ./code/
        Runtime: go1.x
        MemorySize: 64
        Handler: main
        Events:
          TesstApi:
            Type: Api
            Properties:
              Path: /{proxy+}
              Method: any
  </code></pre>
  
  <p>Now I have a main method (in go) </p>
  
  <p>It looks like this:</p>
  
  <pre><code>package main
  
  import (
      "context"
      "log"
  
      "github.com/aws/aws-lambda-go/events"
      "github.com/aws/aws-lambda-go/lambda"
      ginadapter "github.com/awslabs/aws-lambda-go-api-proxy/gin"
      "github.com/gin-gonic/gin"
  )
  
  var ginLambda *ginadapter.GinLambda
  
  func Handler(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error) {
      if ginLambda == nil {
          // stdout and stderr are sent to AWS CloudWatch Logs
          log.Printf("Gin cold start")
          r := gin.Default()
          r.GET("/", Index)
          r.GET("/test/hello", xxx)
          r.GET("/test/hi", xxx)
  
          ginLambda = ginadapter.New(r)
      }
  
      return ginLambda.ProxyWithContext(ctx, req)
  }
  
  func main() {
      lambda.Start(Handler)
  }
  </code></pre>
  
  <p>This works fine. So I can start my local api-gateway with SAM and <code>curl 127.0.0.1:3000/test/hello</code> works well</p>
  
  <p>Now I try to update the following sentence in my template:</p>
  
  <pre><code>  Properties:
      Path: /{proxy+}
      Method: any
  </code></pre>
  
  <p>to </p>
  
  <pre><code>  Properties:
      Path: /test/{proxy+}
      Method: any
  </code></pre>
  
  <p>I want to catch everything after the <code>test</code> path.</p>
  
  <p>I tried the following:</p>
  
  <pre><code>    r.GET("/hello", xxx)
      r.GET("hello", xxx)
      r.GET("/test/hello", xxx)
  </code></pre>
  
  <p>but none of them worked. </p>
  
  <p>Is it possible what I want to do? If yes, How?</p>