├── .gitignore ├── README.md ├── package-lock.json ├── package.json ├── public ├── favicon.ico ├── index.html └── manifest.json └── src ├── App.css ├── App.js ├── App.test.js ├── components └── contacts.js ├── index.css ├── index.js ├── logo.svg └── serviceWorker.js /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Consuming a RESTful API in React 2 | A simple implementation on how to use a RESTful API in React. 3 | 4 | To follow along, this application has been documented as an article on Pusher blog. You can read about it [here](https://pusher.com/tutorials/consume-restful-api-react) 5 | 6 | ## Set up 7 | To set up this project, first clone the repository 8 | ```bash 9 | $ git clone https://github.com/fisayoafolayan/consuming-restful-api-in-react.git 10 | ``` 11 | 12 | Change your working directory into the project directory 13 | ```bash 14 | $ cd consuming-restful-api-in-react 15 | ``` 16 | ## Run 17 | 18 | Install npm modules 19 | ```bash 20 | $ npm install 21 | ``` 22 | 23 | Start the application 24 | ```bash 25 | $ npm start 26 | ``` 27 | 28 | ## Built With 29 | [React](https://github.com/facebook/create-react-app) 30 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-api", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "react": "^16.8.4", 7 | "react-dom": "^16.8.4", 8 | "react-scripts": "2.1.5" 9 | }, 10 | "scripts": { 11 | "start": "react-scripts start", 12 | "build": "react-scripts build", 13 | "test": "react-scripts test", 14 | "eject": "react-scripts eject" 15 | }, 16 | "eslintConfig": { 17 | "extends": "react-app" 18 | }, 19 | "browserslist": [ 20 | ">0.2%", 21 | "not dead", 22 | "not ie <= 11", 23 | "not op_mini all" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fisayoafolayan/consuming-restful-api-in-react/c82987fd7e9861f6645eb525bd607d14516d28c0/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 11 | 12 | 16 | 17 | 26 |{contact.company.catchPhrase}
13 |