DevelopIntelligence helps you onboard, upskill and reskill your tech talent with innovative software developer training.
We do this by designing and delivering learning programs customized to your technology stack, corporate culture and business objectives. Our goal is to make sure your employees know how to apply their new skills to your particular projects.
We shorten the learning curve so your software developers can contribute more quickly to mission-critical endeavors.
All code in this repository is distributed under the MIT license.
To configure the REST API, two packages will need to installed into the project created by the Create React App generator.
- To install those packages, run the following command from within the root folder of the project:
npm install -D json-server npm-run-all
- Next, the
package.json
needs to be updated to easily run the REST API provides by the JSON Server. Here is thescripts
configuration which can be copied and pasted for the REST API. When asked by the instructor, replace thescripts
section of thepackage.json
file in thedemo-app
project with thescripts
section below.
"scripts": {
"start": "run-p web rest",
"web": "react-scripts start",
"rest": "json-server --port 3060 ./db.json",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
- Finally, the REST API data file needs to be created. The data file should be named
db.json
and placed in the project root folder.
VERY IMPORTANT! The db.json
file will be placed in the demo-app
folder, the same folder as the package.json
file. The db.json
file should NOT be placed in the src
folder.
- The JSON below should be copied and pasted into the file.
{
"colors": [
{ "id": 1, "name": "red", "hexcode": "#ff0000" },
{ "id": 2, "name": "green", "hexcode": "#00ff00" },
{ "id": 3, "name": "blue", "hexcode": "#0000ff" }
],
"cars": [
{"id":1,"make":"Ford","model":"Fusion Hybrid","year":2019,"color":"blue","price":45000},
{"id":2,"make":"Tesla","model":"S","year":2018,"color":"red","price":100000}
]
}
- To verify the REST API is working, run the
npm start
command and browse the following URL: http://localhost:3060/cars.
All course content and teaching is provided by: T4D.IO