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

fix serverurl in openapi docs for self hosted instance #4390

Merged

Conversation

brendanlaschke
Copy link
Contributor

closes #4070

Copy link

github-actions bot commented Mar 10, 2024

Warnings
⚠️ Changes were made to the environment variables, but not to the documentation - Please review your changes and check if a change needs to be documented!

TODOs/FIXMEs:

  • //TODO Add once Rest MetaData api is ready: packages/twenty-server/src/core/open-api/open-api.service.ts

Generated by 🚫 dangerJS against b97cf29

Copy link
Member

@magrinj magrinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, just a minor comment !

Comment on lines 39 to 41
const baseUrl =
this.environmentService.getServerUrl() ||
`${request.protocol}://${request.get('host')}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brendanlaschke To avoid declaration of this 2 times, we can create a private function that compute the baseUrl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also remove the trailing slash in case it's present, tested this morning and:
SERVER_URL=https://api.twenty.com works
SERVER_URL=https://api.twenty.com/ does not

Copy link
Member

@magrinj magrinj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change required

@brendanlaschke
Copy link
Contributor Author

brendanlaschke commented Mar 12, 2024

should be fixed :)

Copy link
Member

@charlesBochet charlesBochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@charlesBochet charlesBochet dismissed magrinj’s stale review March 13, 2024 11:13

Changes have been made

@charlesBochet charlesBochet merged commit f847b64 into twentyhq:main Mar 13, 2024
12 checks passed
@brendanlaschke brendanlaschke deleted the docs-baseurl-selfhosted-fix branch March 13, 2024 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The rest docs generator should use the given base URL in sample requests
3 participants