question-mark
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.

'/api/' path should be configurable

See original GitHub issue

The problem

In my case i’m already running an API at the /api/'path so this conflicts. Currently the config only allows for editing the base path /api/${options.base}/

Solution

I would make options.baseinclude the ‘/api/’, so the default would be /api/_content/. This should also function in combination with the options.sources

Other solution

Other options would be to have a separate config option for the /api/ part.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rikzwarthoffcommented, Oct 15, 2022

I agree, i would rather proxy elsewhere, but we may not always have that choice

1reaction
Atinuxcommented, Oct 13, 2022

I would anyway recommend to proxy on another route than /api as best practices since Nuxt server/api/ is already matching to /api.

But happy to chance the base option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring an API path - IBM
An API path defines the API operations that are available on a single path. About this task. Provide the following information when you...
Read more >
Why you should (almost) never use an absolute path to your ...
My personal advice is: never hardcode absolute paths to your APIs again, unless it is a prototype. Spend a bit more time to...
Read more >
How to configure REST API path for PROD environment/QAS ...
I have imported multiple methods from a REST API interface with a base URL in DEV now. Each method under the REST API...
Read more >
Best practices for REST API design - Stack Overflow Blog
We shouldn't use verbs in our endpoint paths. Instead, we should use the nouns which represent the entity that the endpoint that we're ......
Read more >
Configure relative paths
In the Policy Studio tree, select Listeners > API Gateway -> Default Services > Paths. Right-click Paths, and select Add > Relative Path....
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found