接下来我采用蚂蚁金服开源的前后台框架搭建非Java的微服务。
前台:Ant Design(基于Node.js & React)
后台:egg(基于Node.js & Koa)
搭建前台环境
创建项目(详细过程见在 create-react-app 中使用),执行“安装和初始化”和“引入antd”的步骤
用VS Code打开文件夹。
在package.json中增加 :
"proxy": "http://localhost:7001"
重写App.js
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
echo: '',
};
}
componentDidMount() {
fetch('/index').then((res