nuxt / http

Universal HTTP Module for Nuxt.js
https://http.nuxtjs.org
MIT License
229 stars 51 forks source link

Ability to import this module in my application? #193

Open justindasilva opened 2 years ago

justindasilva commented 2 years ago

I use nuxt/http throughout my project in different ways, but mainly within the fetch method. It works great.

One thing I've started doing in my application recently is creating JS files for my forms. Signup.form.js and Login.form.js and all of these forms extend a Base.form.js.

I would like to import nuxt/http into these files if at all possible? Seems like it is not meant for use outside of the Nuxt architecture which is completely understandable. I know I can just use another module such as got or axios to do what I need to do, but then I have to hold a whole other set of configurations to be able to contact my backend API.

If there is no way for me to import nuxt/http to use in any JS file, would I be able to accomplish it by creating a Nuxt plugin? I figure this.http can be accessed within a Nuxt plugin?