You may use lesson plans for guidance during this checkpoint, such as the Express MVC lesson plan.
Fiork and clone this repository. After cloning down your fork...
$ cd checkpoint-express-mongoose-short
$ npm install
To run the tests in the terminal, run npm test
.
- Every time you make a change and save your files, you will need to manually re-run the tests.
- When you start, all of the tests will be failing; your goal is to make as many pass as you can in the hour provided.
- Read the output of the failing tests. It will tell you why the test failed.
Note: The test suite is located in
./test
.
For this checkpoint, you need to build a simple application for tracking Notes.
-
There is already a
package.json
file with the dependencies necessary for running the tests. Install everything else required to build your application server with Express, Mongoose, and Handlebars (usehbs
instead ofexpress-handlebars
). -
Create the following directories
controllers
andviews
. The names must match these exactly, so be careful to pluralize. -
There will be a single model,
Note
, with three fields: anauthor
, atitle
and abody
. -
You should have 3 routes...
GET '/'
which should redirect to `/notes'GET '/notes'
which render view with a list of notesGET '/notes/:someParameter'
where:someParameter
can be used to identify or grab a singleNote
from the database.
- Your application should have the following views...
- A handlebars layout file named
views/layout.hbs
. - A
views/index.hbs
lists the most recently published Notes, showing thetitle
andauthor
of eachNote
. - A show view (
views/show.hbs
) for aNote
that, displays theNote
'stitle
,body
andauthor
.
NOTES:
- We've provided the necessary configuration for the database connection, some of the Model definition, and some of the basic express app boilerplate. Don't delete any of this! Your task is to add to what is provided.
- If your tests time-out, don't exit, try hitting
ctrl-c
. - Do not modify the tests in
tests/index.js
!
Fork this repository and clone your fork locally. Commit as you go. When you are finished, push to GitHub.
Wait until the end of the hour to make your Pull Request