In this assignment you will create your first web server using hapi.
First, we need some basic structure: a lib folder, a test folder, a package.json file, and an initial index.js. Since we will be using hapi, we need to include that in the project dependencies.
Place all of these files within a named folder under submissions. Your file structure will probably look something like this:
Second, create a basic hapi server on port 8000 which responds to /version requests and replies with a simple { "version": "0.0.1" } JSON payload. The version in the response should come from the package.json file.
100% test coverage. You can do it! Checkout lab's coverage utilities or try setting up istanbul with mocha
Submission Details
Fork this repo and submit a pull request for discussion. This is so that we can keep all discussion in a single location while still allowing you to maintain your own project choices.
Assignment due: 1/6/2016
Getting Help
I will also make myself available during the following office hours:
Friday, December 18th, 2015
3:00 - 4:00
Monday, January 4th, 2016
3:00 - 4:00
Please collaborate with other workshoppers!
For anything else, feel free to pair up, schedule work sessions, or post a comment there. At the beginning of next year we will set up a more regular schedule.
What we are building
In this assignment you will create your first web server using hapi.
First, we need some basic structure: a lib folder, a test folder, a package.json file, and an initial index.js. Since we will be using hapi, we need to include that in the project dependencies.
Place all of these files within a named folder under
submissions
. Your file structure will probably look something like this:Second, create a basic hapi server on port 8000 which responds to /version requests and replies with a simple { "version": "0.0.1" } JSON payload. The version in the response should come from the package.json file.
For testing, consider using one of the following:
Acceptance criteria
curl -s http://localhost:8000/version
npm test
and runnable vianpm start
Submission Details
Fork this repo and submit a pull request for discussion. This is so that we can keep all discussion in a single location while still allowing you to maintain your own project choices.
Assignment due: 1/6/2016
Getting Help
I will also make myself available during the following office hours:
Friday, December 18th, 2015 3:00 - 4:00
Monday, January 4th, 2016 3:00 - 4:00
Please collaborate with other workshoppers!
For anything else, feel free to pair up, schedule work sessions, or post a comment there. At the beginning of next year we will set up a more regular schedule.