Comments (3)
Hi @frbuceta, actually the baseURL
has to be an absolute url, otherwise during SSR it cannot know what url to fetch (and it is required), on browser it automatically adds the window.location.hostname
.
You need to use the prefix option when using the proxy:
export default {
http: {
// See https://http.nuxtjs.org/api/#options
prefix: "/api",
proxy: true
},
proxy: {
"/api": {
target: "https://jsonplaceholder.typicode.com",
pathRewrite: { "^/api": "" }
}
},
}
from http.
It should work, do you mind creating a reproduction using https://template.nuxtjs.org please?
from http.
It should work, do you mind creating a reproduction using https://template.nuxtjs.org please?
yes, https://codesandbox.io/s/practical-proskuriakova-zrr9j?file=/pages/index.vue
from http.
Related Issues (20)
- Sometimes 'Only absolute URLs are supported' error
- How to use parameters? HOT 1
- globals.Headers is not a constructor HOT 4
- Type of onError hook's argument is not correct
- onRequest Hook in asyncData causes nuxt generate to hang forever HOT 1
- Universal fetch
- Unable to get Headers HOT 2
- post method headers
- Support KeepAlive (http agent)
- $get does not return a parsed object but a string HOT 3
- req is not defined ||is this project deprecated ? HOT 1
- Dependency Dashboard
- Ability to import this module in my application?
- Auth header
- link to migration guide is missing
- Authorization header capitalization HOT 1
- how to use responseType: 'blob' in the http configuration
- Issue with Nuxt 3 publicRuntimeConfig?
- Default options are ignored when type is object
- Corrupted links HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from http.