Skip to content

adwd/create-react-app-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-react-app-sample

Deploy

create-react-appをベースにした、herokuにデプロイできるReactアプリのサンプルです。
create-react-appが生成するReactアプリにバックエンドのREST APIとの通信を追加しています。

ローカルでの実行

npm i
npm run dev

herokuにデプロイする

> 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アプリにした
  • express サーバーを追加した(server/server.js)
    • GET /todos でTODOリストを返す
    • react-scripts build が出力するhtml, js, cssの静的ファイルを配信する

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy