Skip to content
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

Closed
superandrew213 opened this issue Mar 8, 2019 · 9 comments
Closed

Support Websockets api #207

superandrew213 opened this issue Mar 8, 2019 · 9 comments

Comments

@superandrew213
Copy link

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

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.

custom:
  customDomain:
    domainName: foo.example.tld
    websocket:
        domainName: ws-foo.example.tld
        certificateName: ...
@pavel-ignatiev
Copy link

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?

@captainsidd
Copy link
Contributor

Hi there! This seems doable. if you want to make a pull request implementing these changes, we'll gladly add this feature.

@pavel-ignatiev
Copy link

Hi captainsidd,

thanks - I will work on the solution design then and will get in touch if there is progress or discussion is needed.

@pavel-ignatiev
Copy link

pavel-ignatiev commented Apr 24, 2019

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...

@zavale
Copy link

zavale commented May 18, 2019

@pavel-ignatiev Thanks for taking care of this!
When do you think your PR will be ready and merged?

@superandrew213
Copy link
Author

@pavel-ignatiev you should go ahead and open a PR.

@pavel-ignatiev
Copy link

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.

@jan-wilhelm
Copy link

Any updates?

@aoskotsky-amplify
Copy link
Member

Should be fixed now with #319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants