Skip to content

Questions on use with axios. #29

Answered by ElMassimo
rachitpant asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Rachit, I'll answer all three in case someone runs into this.


Is Axios being used?

You should configure client_library to use @js-from-routes/axios instead:

# config/initializers/js_from_routes.rb
   
if Rails.env.development?
  JsFromRoutes.config do |config|
    config.client_library = '@js-from-routes/axios'
  end
end

Make sure to regenerate the helpers after making this change.


How to configure axios?

You can modify the configuration by importing AxiosConfig:

import { AxiosConfig } from '@js-from-routes/axios'

AxiosConfig.instance = httpClient

Any suggestions where we should configure the client with the config object?

Read this section in the docs.

It's usually convenien…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by ElMassimo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants