Skip to content

React

NOTE For windows users, run all commands from within Ubuntu (WSL)

Create the React app

First, create a new React app:

cd ~
npx create-react-app react-intro
cd react-intro
npm install @testing-library/dom

Start the React app

npm start

This should open http://localhost:3000

You should see a React welcome page.

Run Tests

npm test

This starts an interactive test window. Tests should be green.

Press q or CTRL+C to exit.

Open Gogs

Open the OpenShift Web Console

oc console

Open the App Menu (the 9-box menu)

Click "Git Dev"

Sign In (if needed)

Click Sign In

Enter userXX and the password password

NOTE: get your user number from your instructor

Create Repository

Click "New Repository"

Enter the name react-intro

Click "Create Repository"

Push Local Code to Gogs

Copy the command at the bottom of the screen

Paste the two lines in your Terminal, and use the following credentials:

  • Username is userXX
  • Password is password

Refresh your repository page