Comments (6)
我注释掉了mock但是还是发不出proxy的请求,请问我应该再改哪些地方才能在本地使用proxy
from antd-admin.
@encorehe,没有其他地方了,不过你可以在utils/config.js
里添加一个字段,引入就可以了
from antd-admin.
@mtboom,如果要使用可以本地proxy,
- 使用
npm run start
命令 - 访问
localhost:8989
- 注释掉
src/utils/index.js
里的mock
from antd-admin.
@zuiidea 问题已经解决
使用npm run start命令
访问localhost:8989
注释掉 src/utils/index.js 里的 mock
使用 fetch 发送请求
from antd-admin.
@mtboom
本地proxy怎么配置呢?
是不是类似这样:
"proxy": { "/api": { "target": "http://jsonplaceholder.typicode.com/", "changeOrigin": true, "pathRewrite": { "^/api" : "" } } }
from antd-admin.
我用springboot的zuul做的代理
配置如下,坑了我好久的是必须配置/base/而不是/base,希望能给大家帮助
package.json中
"scripts": {
"start": "dora --plugins "proxy,webpack?publicPath=/base/,webpack-hmr,browser-history?index=/src/index.html"",
"dev": "dora --plugins "webpack?publicPath=/base/,webpack-hmr,browser-history?index=/src/index.html"",
"lint": "eslint --fix --ext .js,.jsx src/components/layout",
"build": "atool-build"
},
zuul配置如下
#eit反向代理到8000端口,多个用,分隔
zuul.routes.base.path=/base/**
zuul.routes.base.url=http://127.0.0.1:8000
zuul.routes.base.stripPrefix=false
#eit.ribbon.listOfServers=127.0.0.1:8080
from antd-admin.
Related Issues (20)
- Change proxy HOT 1
- Failed to load resource: the server responded with a status of 404 (Not Found) 开发环境是正常的,打包后浏览器打开出问题 HOT 3
- 自己写登录接口 HOT 1
- 强强
- 能否提供个typescript版的 HOT 1
- 切换菜单时报错
- 项目启动时报 [ERR_ASSERTION]: filePath not found of antd/lib/locale-provider/pt_BR
- 启动直接报错,我的node版本是18.12.1 HOT 3
- 有没有项目说明文档 HOT 2
- 打开之后无法加载页面 HOT 2
- 111
- Select tag mode bug HOT 1
- npm run start doesn't work HOT 5
- macbook中出现Assertion Error,无法npm run start HOT 3
- develop分支,修改主题色无效 HOT 2
- Proxy 问题 HOT 11
- 技术问题,怎么实现受控表单 HOT 2
- Demo Prevew version diffirence git clone version? HOT 2
- pageing not working HOT 1
- graphgl 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 antd-admin.