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.

How can i use the options.root

See original GitHub issue

Hi, I set the global option of root, Vue.http.options.root = 'www.domain.net', then i could get the value in the whole project. ok. While I think that this will help me to add the root to url automatically. Like this code, finally, i could get the url is " http://www.domain.net/differentPartUrl?token=123".

this.$http.get('/differentPartUrl',   {token: '123'}).then((response) => {
            // success callback
        }, (response) => {
            // error callback
            console.log(response)
        }) 

But I tried several times, all failed. It can’t help me. In the end, the path is like this “/differentPartUrl”.

So I have to set the whole url by myself , like the below:

this.$http.get(this.$http.options.root + '/someUrl?token=123').then((response) => {
            // success callback
        }, (response) => {
            // error callback
            console.log(response)
        })

Luckily, it could work. But I not feel satisfactory, i want to know more.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

23reactions
LinusBorgcommented, Jul 8, 2016

Not a bug.

When using the root option, don’t use a slash at the beginning. Using a slash indicated it should go to <currentdomain>/path

wrong:

this.$http.get('/differentPartUrl',   {token: '123'}).then((response) => {

right:

this.$http.get('differentPartUrl',   {token: '123'}).then((response) => {
2reactions
LinusBorgcommented, Aug 24, 2016

There is either a typo or the API changed: Vue.url.options.root = ... works.

https://jsfiddle.net/Linusborg/nkx2j0jv/

I’ll send in a Pull request later top updater the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A ROOT Guide For Beginners
ROOT is very flexible and provides both a programming interface to use in own applications and a graphical user interface for interactive data...
Read more >
Option Class Reference - ROOT
Returns a pointer to the first element of the linked list. Use this when you want the first occurrence of an option on...
Read more >
A ROOT Guide For Beginners “Diving Into ROOT”
ROOT is a software framework for data analysis and I/O: a powerful tool to cope with the demanding tasks, typically state of the...
Read more >
CERN ROOT Tutorial 24: Using Input Parameters - YouTube
You can visit the full playlist for watching all videos of this tutorial ...
Read more >
CERN ROOT Tutorial 9: Fit Function and Parameters - YouTube
CERN ROOT Tutorial 9: Fit Function and Parameters ... This ROOT tutorial shows, how to fit ROOT built-in functions to data in a...
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