Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mounting wildcard at a different url

See original GitHub issue

Hey Romuald 😃

I’ve been really struggling with getting Wildcard to work at a different URL than the one that is default /wildcard/*

For one of my next apps, I need to mount the api at a sub-path on the server - so /reports/_api/wildcard*.

I’ve tried messing around with serverUrl on the client, and while I can tell it to use http://localhost:8080/reports/_api/wildcard - when that endpoint is actually hit, wildcard responds that no endpoint was hit (or just ignores the request).

I’ve mounted wildcard at that path on my server using koa-router, and I’ve confirmed that it is definitely hitting wildcard, but the requests are falling through.

Looking into wildcard’s code, I assume this is the problematic section:

    !['GET', 'POST'].includes(method) ||
    !isPathanameBase({pathname}) && !pathname.startsWith(API_URL_BASE)
    return {isNotWildcardRequest: true, isHumanMode};

It appears that wildcard will always fail unless the path starts with /wildcard ? In my case, the path is /reports/_api/wildcard

Am I maybe missing something?

Is there no way to tell the server which wildcard base path is correct? A way to set API_URL_BASE manually perhaps.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

brilloutcommented, Apr 14, 2020

Yes serverUrl and baseUrl have different uses case, it’s prob better to separate their configuration.

The weather has been spectacular lately […] few cold ones next to the Seine!

Yes! And with some sweet potatoes 😃.

lostpebblecommented, Apr 14, 2020

Thanks @brillout ! Seems to be working perfect.

And especially thanks for making it as easy as setting baseUrl directly instead of serverUrl - really makes the configuration a lot easier because you don’t need to account for which host to point it to localhost:8080 or the live version https://....

Since you’ll have two Wildcard APIs, you may need to have two different Wildcard client instances that have distinct serverUrl. You can already do that today but it’s undocumented- let me know if you stumble upon this situation.

Cool, yea shouldn’t be a problem, as the regular Vibescout app will point to /_wildcard_api/ now, and this one is pointing to /reports/_api/wildcard. But definitely something to keep in mind in the future.

I usually travel to Paris every summer, if the curfew situation improves, then let’s grab a drink 😃.

For sure! Hopefully we all get a bit of free movement soon enough. The weather has been spectacular lately - its so hard having to be stuck indoors instead of enjoying a few cold ones next to the Seine!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Install Wildcard SSL Certificate on Multiple Servers
There are two major steps involved in installing Wildcard SSL certificate multiple levels subdomains — Generating the Certificate Signing Request (CSR) and then ......
Read more >
How (and Why) to Install a Wildcard SSL Certificate on Your ...
Learn about the differences between normal and wildcard SSL certificates, and how to install a wildcard SSL on your WordPress site.
Read more >
How to Add Your Wildcard SSL to Other Websites
Navigate to your subdomain website where you want to install the Wildcard ... Click on the 'New Certificate' tab and click the 'Upload...
Read more >
Steps to Install Wildcard SSL Certificate on Multiple Servers
A wildcard SSL/TLS certificate secures all the subdomains under a single SSL certificate. When subdomains exist on one server, it means that you ......
Read more >
Adding HTTP Wildcard Redirects <add> - Microsoft Learn
Wildcard rules allow you to add redirection rules for groups of content. For example, if you have removed all of your *.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found