Create a server in Servi to manage a simple web site. The site will have, at minimum, the following pages:
- Home page
- A static page, for example, "About" or "FAQ"
- A set of dynamically generated pages that all have the same structure but contain different data. For example, in an online store, each product has its own page and all of the product pages use the same template.
The focus of this assignment is process over product. You will build out the site using an iterative process, starting small and adding new features to your project as you go. Instead of turning in a URL to a live server, as we've done in previous assignments, you'll turn in a link to a gist project containing 3 files.
To complete this assignment, download this gist. It contains 3 files: server_v1.js
, server_v2.js
, and server_v3.js
. Each file is a version of a project that builds off the previous one.
Build your project in 3 steps:
-
Step 1 ( server_v1.js ) : Define at least 2 static routes in servi. One should be the route at the root level, with the path
'/'
, aka the home page. The initial set-up code is written for you inserver_v1.js
. See that file for more information and examples. -
Step 2 (server_v2.js) : Building off step 1, define a dynamic route in Servi. The route will use a variable in the format,
'/stuff/:something'
. See the fileserver_v2.js
for details. There is also a related example in the repo for this course: 01-servi-userprofiles -
Step 3 (server_v3.js) : Working from your previous version, set up some data in an object or an array, and use the route variable to pull a particular piece of the data. See the file
server_v3.js
for some examples of how to structure data in an object or an array. This file does not include starting code; use your code from version 2 as a base. See this related example in the repo: 02-servi-userprofiles-data. -
Optional Step 4 : If you like, you can use HTML templates to format your pages. See the instructions on how to use templates with Servi and the Servi template example in the repo
####To Submit the Assigment
When you are ready to submit the assignment, fork this gist project and edit each of the files to contain your code instead of mine. Overwrite the README.md
document to describe your project and your process.