How does this gem work with subdomains? #43
Unanswered
reinvanimschoot
asked this question in
Q&A
Replies: 1 comment
-
Hi Rein! These libraries typically deal with paths without the domain, so you'd need to bake something yourself to support adding the origin and subdomain. You could create your own extension to /**
* Defines a path helper that can make a request or interpolate a URL path.
*
* @param {Method} method An HTTP method
* @param {string} pathTemplate The path with params placeholders (if any).
*/
export function definePathHelper (method: Method, pathTemplate: string): PathHelper {
const helper = <T = any>(options?: Options) =>
request(method, pathTemplate, options) as Promise<T>
helper.path = (options?: UrlOptions) => formatUrlWithSubdomain(pathTemplate, options)
helper.pathTemplate = pathTemplate
return helper
} Then, in Ruby configure |
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
-
I am trying to convert something like
homeUrl({ subdomain: 'business' })
to this gem. Is there any support for the usage of subdomains?Cheers!
Beta Was this translation helpful? Give feedback.
All reactions