export const fetchCoWorkers = async () => {
const url = 'http://localhost:3001/api/v1/coworkers'
const response = await fetch(url);
if (!response.ok) {
throw new Error('There was an error getting your co-workers.');
}
const coWorkers = await response.json();
return coWorkers
}
Edited and formatted by ericwm76
Eric's gist https://gist.github.com/ericwm76/e1204fc03f14af4429add8225ff55f71
- In the terminal run:
npx create-react-app NAME-OF-APP
- Cd into the new directory:
cd NAME-OF-APP
- Run:
npm install
. - You can run
npm start
to see if the app was set up correctly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style type="text/css"> | |
#main { padding: 100px; border: 2px solid pink; } | |
.blue { background-color: blue; } | |
</style> | |
</head> | |
<body> | |
<div id="main">Lorem ipsum dolor!</div> | |
<script type="text/javascript"> |