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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create API custom domain and mappings #13

Merged
merged 1 commit into from
Aug 22, 2022

Conversation

mbklein
Copy link
Contributor

@mbklein mbklein commented Aug 19, 2022

Description

  • Add custom domain and base mappings to template.yml
    • dc-api-v2 on /api/v2
    • elastic-proxy on /api/v1
  • Fix baseUrl helper to account for differences between:
    • Access via localhost (when running sam local)
    • Access via dev hostname (USER.dev.rdc.library.northwestern.edu) (when running sam.local)
    • Access via the API Gateway (API_ID.execute-api.us-east-1.amazonaws.com) URL
    • Access via the custom domain with a base path mapping
  • Update tests to cover the above change

This has been deployed to staging (as there was no other way to test), and the new parameters to support it added to samconfig.toml in the tfvars repo.

Testing

  • Dev Environment
    • Run sam local start-api --host 0.0.0.0
    • If testing from a remote client, make sure port 3000 is open (sg open all 3000)
    • Try some requests using http://localhost:3000/ as the base
    • Try some requests using http://USER.dev.rdc.library.northwestern.edu:3000/ as the base
  • Staging
    • Try some requests using https://pylxu5f2l2.execute-api.us-east-1.amazonaws.com/v2/ as the base
    • Try some requests using https://dcapi.rdc-staging.library.northwestern.edu/api/v2/ as the base

In all of the above cases, try to access some of the URLs in the pagination block to make sure they have the right host, port, and path.

@mbklein mbklein requested a review from kdid August 19, 2022 13:41
@kdid
Copy link
Contributor

kdid commented Aug 22, 2022

@mbklein - The local base http://kdid.dev.rdc.library.northwestern.edu:3000/ is not working for me. It just hangs.

curl -X GET 'http://kdid.dev.rdc.library.northwestern.edu:3000/works/4359936f-9091-499b-893f-b8e900db49ec' | jq
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:01:15 --:--:--     0
curl: (28) Failed to connect to kdid.dev.rdc.library.northwestern.edu port 3000 after 75059 ms: Operation timed out

@mbklein mbklein merged commit fece771 into deploy/staging Aug 22, 2022
@mbklein mbklein deleted the 3061-api-domain-config branch August 22, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants