This repo contains the starter code for the final exam for COMP 426.
The purpose of this exam is to help you pull together your backend API server from a04 with a frontend interface written in HTMl+CSs+JS meant to be run in the browser.
Before continuing any further, please note the following:
This exam has two parts.
The first is a questionnaire that you should have received via an email link. If you did not, the link is also here: https://unc.az1.qualtrics.com/jfe/form/SV_cImKRp21KDuVxeC
The second is structured just like all the other assignments.
You MUST not clone this repository directly.
Follow this link to create your own personalized version of the exam repository: https://classroom.github.com/a/d83Ec2gW
Nota bene:
The autograder will NOT be online immediately. You need to take a few days to try to make this work on your own first. You can definitely do it.
./public/img/
that you can use if you wish.docs
directory to your repository and include screenshots of your interface before play (interface) and after play (results). Name the screenshots 01-interface
and 02-result
with the appropriate file extension ( e.g. .png
or .jpg
, etc.)../public
directory and run the server. index.html
file, put links in the <head>
section to the scripts.js
(https://www.w3schools.com/tags/att_script_src.asp) and styles.css
(https://www.w3schools.com/css/css_howto.asp) files.scripts.js
styles.css
file.You will need a few functions to make this work. Here are some examples:
/app/
appended after the base URL and then whatever route for a particular endpoint). You will need to add your endpoint definitions and other relevant code from a04 to this starter code to make your API function and serve on the same address as your frontend.
Your default endpoint for the API should be /app/
.
Everything else should follow from the requirements for a04 for endpoints, depending on what you need for the frontend.
For testing HTML or related JS and CSS you are actively working on:
npm test
For the full run instructions, see the help message:
usage: node server.js --port=5000
This package serves the static HTML, CSS, and JS files in a /public directory.
It also creates logs in a common log format (CLF) so that you can better.
--stat, -s Specify the directory for static files to be served
Default: ./public/
--port, -p Specify the port for the HTTP server to listen on
Default: 8080
--log, -l Specify the directory for the log files
Default: ./log/
--help, -h Displays this help message and exit 0
(Does not work when run with nodemon)
--debug Echos more information to STDOUT so that you can see what is
stored in internal variables, etc.
Look also at the script lines in the package.json
:
"scripts": {
"test": "nodemon -e js,css,html server.js --port=5000 --debug",
"start": "node server.js",
"demo": "nodemon -e js,css,html server.js --port=5000 --stat=demo"
},
Using nodemon will let the server reload when you make changes to your HTML, JS, or CSS. Otherwise you will have to kill and reload the process.
docs
directory as listed above.These checks will be embargoed until LDOC to give you time to figure this out on your own.