从React中的localhost读取

时间:2017-09-02 17:22:23

标签: javascript reactjs react-router

我需要从运行我的React的同一台服务器加载异步,但是这不起作用(如果我从远程设置路径它工作),错误是Invalid URI

request.get('statefulsetv.yaml', function (error, response, body) {
            console.log(error);
            if (!error && response.statusCode == 200) {
                var data = yaml.load(body);
                // console.log(data);
                containers = data.spec.template.spec.containers;
                self.setState({ containers_state: containers });



                // Continue with your processing here.
            }
        });

0 个答案:

没有答案