Created
September 14, 2020 01:25
-
-
Save pablomujica/967a598f7765cfc1ceea35241a10511f to your computer and use it in GitHub Desktop.
Proxy the Azure Functions local instance in Vue to the API Path for Azure Static Sites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Create the file vue.config.js in the root of the project. | |
2. Add the following content: | |
``` javascript | |
module.exports = { | |
devServer: { | |
proxy: { | |
'/api': { | |
target: 'http://localhost:7071', | |
ws: true, | |
changeOrigin: true | |
} | |
} | |
} | |
} | |
``` | |
3. Restart the local server: npm run serve. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment