React Demo with the OMDB API
To install or update nvm, run the install script for nvm located here or using the following commands.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
If you have troubleshooting issues, check out the github repo for nvm.
To install nvm on Windows, download the installer here.
If you have issues or need more info, check out the github repo for nvm-windows.
We need to install the latest version of node and make sure we use it.
nvm install 14
nvm use 14
node --version
This repo contains starter code (with some CSS formatting and the file structure) and the finished code from the demo. Take a peek or try running it locally by running a few commands below.
git clone https://github.com/kristenkoyanagi/react-with-apis
cd react-with-apis
cd starter-app #or finished-app
yarn install #or npm install
yarn start #or npm start
- Change
.env.example
to.env
- Sign up for a free API Key at OMDB API link
- Make sure your API key enabled
- Add your API key to
.env
in the space provided - Restart your app
Run the create-react-app
Run either block of commands below.
npm init react-app my-app
cd my-app
npm start
npx create-react-app my-app
cd my-app
npm start
npm and yarn are separate node package managers that helps you install dependencies, test, run, and build your app. You can use either one as long as you stick with one.
If you open http://localhost:3000, you should see the starter app running from the create-react-app
command.
Check some of these out if you want to learn more about React: