Home > Web Front-end > uni-app > How to set up proxy in uniapp

How to set up proxy in uniapp

coldplay.xixi
Release: 2023-01-13 00:44:10
Original
17751 people have browsed it

How to set up the proxy for uniapp: First open HbuilderX and find the [manifest.json] file; then find the configuration information of the h5 location, add the proxy configuration information; and finally restart the project.

How to set up proxy in uniapp

The operating environment of this tutorial: windows7 system, uni-app2.5.1 version, thinkpad t480 computer.

Recommended (free): uni-app development tutorial

Uniapp method to set up a proxy:

Open HbuilderX and find the manifest.json file, click on the source code view, as shown below:

How to set up proxy in uniapp

Find the configuration information of the h5 location and add the proxy configuration information. As follows:

Add proxy proxy configuration item content in devServer

"devServer" : {
"https" : false,
"proxy": {  
"/web": {  
"target": "http://dev.demo.com",
"changeOrigin": true,   
"secure": false,
"pathRewrite": {
"^/web": "/"  
}  
}  
}  
},
Copy after login

Then restart the project, it will be ok

Related free recommendations: Programming video courses

The above is the detailed content of How to set up proxy in uniapp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template