Skip to content

Using custom backend endpoint instead of localhost #11

Answered by jbaiter
andybuki asked this question in Q&A
Discussion options

You must be logged in to vote

I assume you're refering to this piece of code in pdiiif-web/src/main.ts?

if (!apiEndpoint) {
apiEndpoint = import.meta.env.DEV
? 'http://localhost:31337/api'
: `${window.location.toString().replace(/\/$/g, '')}/api`;
}

This is just a default value for the address where the backend API is located (for generating the cover page and for the server-based fallback). You can simply override this by setting the PDIIIF_API_ENDPOINT environment variable during the build (import.meta.env is resolved at build time, see the vite docs here).

For example, to use https://example.com/pdiiif/api as the backend l…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@andybuki
Comment options

Answer selected by jbaiter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants