Generated Client Domain Name #713
PhakornKiong
started this conversation in
Suggestions
Replies: 1 comment
-
Environment is helper but you can easily pass a custom domain to the construct. /**
* Creates a Client for calling the public and authenticated APIs of your Encore application.
*
* @param target The target which the client should be configured to use. See Local and Environment for options.
* @param options Options for the client
*/
constructor(target: BaseURL, options?: ClientOptions)
constructor(target: string | BaseURL = "prod", options?: string | ClientOptions) {
// Convert the old constructor parameters to a BaseURL object and a ClientOptions object
if (!target.startsWith("http://") && !target.startsWith("https://")) {
target = Environment(target)
}
if (typeof options === "string") {
options = { auth: options }
} Example: const client = new Client("https://mycustomdomain.com") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://encore.dev/docs/deploy/custom-domains
Once a custom domain is setup, It would be great to use that domain in the generated client library.
If i understand it correctly, based on the code below, it is fixed to
encr.app
for now.encore/internal/clientgen/typescript.go
Lines 521 to 526 in 18f0e82
Beta Was this translation helpful? Give feedback.
All reactions