a example of eggjs, react, antd, dva, webpack, mysql, restful api and other stuff made it work...
Switch branches/tags
Nothing to show
Clone or download
Latest commit 0b0187d Oct 17, 2018


Egg Restapi Module Tool

a example of eggjs2.0, react, antd, dva2.0, webpack, mysql, restful api and other stuff made it work...

you can generate rest api eazily by this tool.


update note:

2017-07-10 initial

2017-07-17 egg-restapi-module-tool v0.9 Released

2017-12-01 update login module with oauth2.0

2018-01-03 update dva to dva2.0

2018-01-04 update egg to egg2.0

Examples for egg

use react, Antd and dva to develop front end modules. use eggjs and mysql to be backend. you can use npm run dev to develop both side's service. or use it as a boilerplate.

this example include two modules: 1 modules manager : module table's CRUD operation, 2 request manager : an note for restful api witch is generated by module tool.



install mysql start mysql import testdb.sql to mysql

npm i egg-bin --save-dev
npm install

Start up:

run npm to start server

npm run dev

Go to http://localhost:8080

also you can : npm run dev_static to start front react project npm run server to start egg server npm run dev to start both


$ npm run build
$ npm run pro

npm run build to build the front end react project. npm run pro in server to start project on you server visit http://serverIP:7001

REST API Example

api/restql/users GET List


api/restql/users/1 GET Single Data


api/restql/users/2 PUT Update data with uid


api/restql/users POST insert data


same with news and news_type for rest api data.

screen shot

login.png page1.png page2.png page3.png

Thank you