-
Create a mysql database
1.1 (My method) Install docker
1.2 Install Docker Compose
1.3 Run
docker-compose up -d
or use docker run on a mysql container -
mysql -h 127.0.0.1 -P 3306 -u root -p(Your password)
-
Copy InnitDB to initialise Database
-
Install Node
-
npm install mysql --save
Install mysql for node -
npm install express --save
Install express for node -
node web-server.js
To run web-server -
curl localhost:5000/submit-new
[
{
"instruction_id":1,
"course_name":"Porridge",
"step":"Get Boiling Water",
"step_id":null,
"photo_address":null
},
{
"instruction_id":2,
"course_name":"Python",
"step":"Make Computer",
"step_id":null,
"photo_address":null
},
{
"instruction_id":3,
"course_name":"Php",
"step":"True True",
"step_id":null,
"photo_address":"https://icatcare.org/app/uploads/2018/07/Thinking-of-getting-a-cat.png"
},
{
"instruction_id":4,
"course_name":"Lasagne",
"step":"Make Mince",
"step_id":null,
"photo_address":"https://nerdist.com/wp-content/uploads/2020/07/maxresdefault.jpg"
}
]
MONGO VERSION run docker-compose-up run mongo run use testBase (creates database called course) run use course (creates table called course) run node web-server-mongo.js run the command in mongodata.sh curl localhost:5000/get-course