-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove $axios as a dependency #66
Comments
Hey @madebyfabian, the docs say that Apart from that, I'd like to get rid of |
Thanks for your comment! |
@madebyfabian You're welcome :). Regarding the fetch: Just note that sending also needs to work server side, not only client side. |
I've worked on an implementation on a fork, currently using fetch on client-side, which looks like this: I've tested it, and it perfectly works when no @nuxtjs/axios is installed. Will have a look if there is also a possibility to get it to work at server-side, without any dependencies. Do you might have some examples in which cases the $mail.send could be called on server-side? |
@madebyfabian Use case is pretty much the same as client side but you submit a form, which will post the current route and then you get the request parameters server-side (e.g. via |
Thanks for the example, I thought something very similar. So i managed to get it to work on client- and server-side. Actually, nuxt automatically uses node-fetch instead of window.fetch when you are using the fetch api on the server-side. But I got the following error: Which basically says that node-fetch can't fetch /mail/send, since It doesn't know on which hostname this endpoint is. The downside is, that
it will call the endpoint with unsafe http, even if you're currently on a https endpoint. But because it's an internal call that happens on the server itsself, I think it should be fine. What do you think? The problem is, that nuxt doesn't know the current url it's on. I am only able to get the current hostname from the http-headers in |
@madebyfabian hmm I think I need to have a close look on this. But I'm pretty busy at the moment unfortunately. |
Note: Other possibility is to add |
@madebyfabian I have an open PR that would solve the issue feel free to have a look! |
Closed since Nuxt 3 is on the go |
Hi there!
Really love the plugin, but one thing is very misleading. The docs say that you can send a message like this:
but actually I can't, because I don't have the nuxt/axios module installed. Maybe simply change this
into window.fetch(...)?
Best,
Fabian
The text was updated successfully, but these errors were encountered: