Koa & React
Koa backend & React frontend
Run
Run docker and visit http://localhost:3000:
$ docker-compose up
How to build it from scratch?
Create project folder:
$ mkdir koa-react $ cd koa-react
Install
koa-generator
:$ npm install koa-generator -g
Create Koa backend app, install dependencies:
$ koa2 back $ cd back $ npm install
Change default port from
3000
to8000
inbin/www
.Create React frontend app in project folder, install dependencies:
$ npx create-react-app front $ cd front $ npm install
Add
"proxy": "http://back:8000"
to the package.json in frontend app.Create separate
Dockerfile
in back and front apps anddocker-compose.yml
in project folder.