公司项目前后端分离,我现在想用mockjs模拟数据进行ajax请求,但是不知道在react中如何配置,请问哪位大神有用过?最好有简单的demo最好。拜谢
公司项目前后端分离,我现在想用mockjs模拟数据进行ajax请求,但是不知道在react中如何配置,请问哪位大神有用过?最好有简单的demo最好。拜谢
use webpack inner Express to set it
following definitive guide you can learn more details:
devServer.before
Provides the ability to execute custom middleware prior to all other middleware internally within the server. This could be used to define custom handlers, for example:
before(app){
app.get('/some/path', function(req, res) {
res.json({ custom: 'response' });
});
}
10 回答11.7k 阅读
2 回答3.2k 阅读✓ 已解决
4 回答2.2k 阅读✓ 已解决
3 回答1.2k 阅读✓ 已解决
1 回答1.8k 阅读✓ 已解决
3 回答858 阅读✓ 已解决
3 回答1k 阅读✓ 已解决
不是直接引入就可以了吗?我之前玩的时候就导入就好了。