Open JaroVDH opened 9 months ago
This is an uncommon use case, but it's possible to have multiple endpoints with the same route if you have both REST & HTTP in use. For example, if you're migrating from one to the other and run them in parallel:
functions: main: handler: src/index.handle events: - http: path: / - httpApi: path: /
Or if you have two fully distinct APIs that just happen to have matching paths in routes:
functions: oneApi: handler: src/one/index.handle events: - http: path: /{proxy} otherApi: handler: src/other/index.handle events: - httpApi: path: /{proxy}
Currently Serverless Offline will fail with AssertError: New route X conflicts with existing X.
AssertError: New route X conflicts with existing X
Expected behavior I'm not sure what the best way to handle this would be. Some ways this could be handled:
Custom prefix per event type
custom: serverless-offline: prefix: http: "rest" httpApi: "http"
Overloading the prefix type would make the documentation more confusing, though.
Ignoring some event types
You could then run multiple instances of sls offline which ignore different sets of events.
custom: serverless-offline: ignoreEvents: - httpApi
custom: serverless-offline: prependEventInUrl: true
Feature Request
This is an uncommon use case, but it's possible to have multiple endpoints with the same route if you have both REST & HTTP in use. For example, if you're migrating from one to the other and run them in parallel:
Or if you have two fully distinct APIs that just happen to have matching paths in routes:
Currently Serverless Offline will fail with
AssertError: New route X conflicts with existing X
.Expected behavior I'm not sure what the best way to handle this would be. Some ways this could be handled:
Custom prefix per event type
Overloading the prefix type would make the documentation more confusing, though.
Ignoring some event types
You could then run multiple instances of sls offline which ignore different sets of events.