https://www.screencast.com/t/fb2EgPdK
-
cd AWSQUIZ/backend
-
npm install
-
npm start
To run in developer mode which restarts server on file save:
- npm run serve (instead of npm start)
Contrived file names to make it easy to follow
Note these would be folders of same name in actual app
Great blog post on express api structure below
https://www.coreycleary.me/project-structure-for-an-express-rest-api-when-there-is-no-standard-way
app.js - run backend server
route.js - direct endpoint calls to controller
controller.js - strip out request data -> validate it -> call service
service.js - business logic (maybe better to validate here) -> shape data -> call db
db.js - calls to backend storage (services.json) change to any backend storage
GET
http://localhost:3000/learn/:catagory
ex:
http://localhost:3000/learn/compute
POST
http://localhost:3000/learn/:catagory
body
{
"question": "Fully managed ground station as a service",
"answer": "AWS Ground Station",
"distractors": [
"Amazon Managed Streaming for Apache Kafka",
"AWS Device Farm",
"Amazon Translate"
]
}
I borrowed front end heavily from
https://github.com/jamesqquick/Build-A-Quiz-App-With-HTML-CSS-and-JavaScript
-
cd AWSQUIZ/frontend
-
npm install
-
npm start
follow simple game at localhost:4000
not necessary to run game - I just wrote to build json questions
aws.txt - list of AWS services and descriptions by catagory
aws.json - json format created by app.js. used for backend as services.json
app.js - parses aws.txt -> creates aws.json
list of services to create aws.json copied from
https://www.techradar.com/news/aws
list of acronyms to create awsacronyms.json copied from
https://geekflare.com/about/