美文网首页
react 使用子路由

react 使用子路由

作者: 小葵饭_七安 | 来源:发表于2019-08-05 17:11 被阅读0次

在index.js里配置跨域啊等等   然后比如用户相关的请求新建一个user.js文件   具体见图

在index.js里启用子路由

然后在user.js里const express=require('express')

const router=require('router')

最后导出  module.exports=router就可以了

比如book.js等等如上用法就可以了

相关文章

网友评论

      本文标题:react 使用子路由

      本文链接:https://www.haomeiwen.com/subject/cnomdctx.html