diff --git a/README.md b/README.md index 7f9f755..0164eef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # create-react-app-sample +[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) + [create-react-app](https://github.com/facebookincubator/create-react-app)をベースにした、herokuにデプロイできるReactアプリのサンプルです。
create-react-appが生成するReactアプリにバックエンドのREST APIとの通信を追加しています。 @@ -10,6 +12,22 @@ npm i npm run dev ``` +## herokuにデプロイする + +```sh +> heroku create (11s 634ms) +Creating app... done, ⬢ ancient-savannah-28074 +https://ancient-savannah-28074.herokuapp.com/ | https://git.heroku.com/ancient-savannah-28074.git +> heroku git:remote -a ancient-savannah-28074 (3s 317ms) +set git remote heroku to https://git.heroku.com/ancient-savannah-28074.git +> git push heroku master +... +remote: Verifying deploy.... done. +To https://git.heroku.com/ancient-savannah-28074.git + * [new branch] master -> master +> heroku open +``` + ## create-react-appからの変更点 - `/todos` にGETリクエストを出すReactアプリにした diff --git a/app.json b/app.json new file mode 100644 index 0000000..8e1d4e5 --- /dev/null +++ b/app.json @@ -0,0 +1,7 @@ +{ + "name": "create-react-app sample", + "description": "A React.js application using create-react-app with express backend", + "repository": "https://github.com/adwd/create-react-app-sample", + "logo": "https://node-js-sample.herokuapp.com/node.png", + "keywords": ["node", "express", "react", "create-react-app"] +} \ No newline at end of file diff --git a/package.json b/package.json index 9bc6075..2bb81f0 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,12 @@ "name": "cra-sample", "version": "0.1.0", "private": true, - "devDependencies": { - "npm-run-all": "^3.1.0", - "react-scripts": "0.6.1" - }, "dependencies": { "express": "^4.14.0", "react": "^15.3.2", - "react-dom": "^15.3.2" + "react-dom": "^15.3.2", + "npm-run-all": "^3.1.0", + "react-scripts": "0.6.1" }, "scripts": { "start:dev": "react-scripts start",