New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Websockets api #207
Comments
Hi, I'm looking for very similar functionality and would gladly submit a PR if things work out well. In our case there is unfortunately no possibility for splitting the service which operates on both REST and WSS APIs in multiple services with different Serverless configurations. If my understanding of the AWS documentation is correct, this is in fact necessary to generate different custom domains for different API types. As chriszirkel stated in his comment to the similar issue, an API gateway should be created per such custom domain. The configuration could then look like this: custom:
customDomain:
rest:
domainName: foo.example.tld
apiGateway: gateway1
function: rest-function
websocket:
domainName: ws-foo.example.tld
apiGateway: gateway2
function: wss-function Do you think such a concept could be viable? Are there any compelling reasons? |
Hi there! This seems doable. if you want to make a pull request implementing these changes, we'll gladly add this feature. |
Hi captainsidd, thanks - I will work on the solution design then and will get in touch if there is progress or discussion is needed. |
Hi there, I managed to make this feature work in my environment and used following serverless.yml configuration: custom:
subdomains:
dev: mydomain-dev
staging: mydomain-staging
prod: mydomain
subdomainsWS:
dev: mydomain-ws-dev
staging: mydomain-ws-staging
prod: mydomain-ws
customDomain:
domainName: '${self:custom.subdomains.${self:provider.stage}}.mytld'
basePath: v1
stage: '${self:provider.stage}'
certificateName: '*.mytld'
createRoute53Record: true
endpointType: 'EDGE'
websockets:
domainName: '${self:custom.subdomainsWS.${self:provider.stage}}.mytld'
basePath: v1
createRoute53Record: true
certificateName: '*.mytld'
endpointType: 'REGIONAL'
stage: '${self:provider.stage}' The original unit tests fail of course with this configuration. Do you think this config is backwards compatible enough? Any suggestions? Is it OK for me to modify tests accordingly? Update: Working on test coverage now... |
@pavel-ignatiev Thanks for taking care of this! |
@pavel-ignatiev you should go ahead and open a PR. |
Hi there! I didn't really have time since the last update to prepare the PR but I'm working towards it now, I expect to open a PR tomorrow in the evening. |
Any updates? |
Should be fixed now with #319 |
Community Note
Feature Request
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
Add websockets support. Should support REST or Websockets api and both.
The text was updated successfully, but these errors were encountered: