Commit b6656c34 by 马贞晓

完成配置

1 parent 2f02f1e7
......@@ -50,6 +50,7 @@ dotenvFiles.forEach(dotenvFile => {
// https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
// We also resolve them to make sure all tools using them work consistently.
const appDirectory = fs.realpathSync(process.cwd());
process.env.NODE_PATH = (process.env.NODE_PATH || '')
.split(path.delimiter)
.filter(folder => folder && !path.isAbsolute(folder))
......
......@@ -85,12 +85,14 @@ module.exports = function(proxy, allowedHost) {
public: allowedHost,
proxy:{
"/api": {
target: "https://www.jianshu.com/shakespeare/notes/2ce732125376/recommendations",
target: "http://192.168.0.8:8080/",
pathRewrite: {"^/api" : ""}
}
},
before(app, server) {
app.get('/test', function(req, res) {
res.json({ data: 'test2' });
});
// console.log(path.join(__dirname,'../src/service/mock/index.js'))
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
......
......@@ -17,7 +17,14 @@ import $http from "../../service";
componentDidMount(){
// debugger
console.log($http)
$http.GET("/api")
$http.GET("/test")
.then(d=>{
debugger
})
.catch(e=>{
debugger
})
$http.GET("/api/demo")
.then(d=>{
debugger
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!