Skip to content

Monograph API_HOST is wrong and should be public #75

@ibaraki-douji

Description

@ibaraki-douji

The issue

The env var "API_HOST" for the monograph container, should be the public URL of the API container, and not the internal docker name of the API container.

API_HOST: http://notesnook-server:5264

The reason why

When looking at the monograph code we can see the API_HOST is defined here :
https://github.com/streetwriters/notesnook/blob/8435e69cb59100b4c1ec70faec36dd0628605cba/apps/monograph/app/utils/env.ts#L21

And is used both internally in the monograph server AND in the html sent to the user :
https://github.com/streetwriters/notesnook/blob/8435e69cb59100b4c1ec70faec36dd0628605cba/apps/monograph/app/components/monographpost/index.tsx#L232

And because it's also sent in the html to the user, the request to the API "/monographs/<ID>/view" does not work as it's the internal URL and not the public URL. (Can be shown in the devtools > Network tab > look for the failed request)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions