Skip to content

Latest commit

 

History

History
54 lines (47 loc) · 3.66 KB

a0.0.6.md

File metadata and controls

54 lines (47 loc) · 3.66 KB

[Assignment6] Static Assets, Partials, and TLS

Configure the application to use TLS/SSL

  • Generate your own TLS/SSL certificate
  • Make "certs" directory in ./lib.
  • Place the certificates you generate into "certs" directory.

Configure two server connections

  • One labelled ['web'] on port 8000 with no TLS configured.
  • The other labelled ['web-tls'] on port 8001 will use TLS.
    Configure this connection to use the ssl/tls certificates you just generated
    and placed in ./lib/certs

Use TLS everywhere

Configure the application to always use TLS [Transport Layer Security] (http://en.wikipedia.org/wiki/Transport_Layer_Security).
Every http request should be redirected to https. Two references:

Configure the home plugin.

  • Make a new point in the home plugin called: "login"
    • Make login route display view template named login.html.
  • Use partials to display the login form
    • make a directory inside of the ./views called partials
    • configure the home plugin to use the ./views/partials directory to load partials from.
      • In ./views/partials/ directory make a file named form.html.
        • form should have two inputs one type="text" named "username" and the second type="password" named "password".
        • form should have one submission button with text value "Login".
      • Inside login.html template load the partial file named "form.html"

Use Static Assets

  • Make directory in root of project called "assets".
  • Inside the assets directory, make three directories:
    "styles" for css, "scripts" for JS scripts,
    "images" for project images.
    • Place Hapi University logo into the images directory
      and display it on the home page (home.html). (image is in the repo ./images/logo.png)
    • Place a CSS file in the stylesheets directory (styles).
      Name css file styles.css:
      • Make one simple style:
        h3 { font-size: 24px; font-weight: bold; }
      • Use the stylesheet in home.html. Make a title inside h3 tags.
    • Make a script named login.js and put in ./assets/scripts
      • Make this script print a console message to the browser when the form button is clicked.
    • In the home plugin configure the application to serve these static assets.
    • Make a login link in home.html that links to the login route.

100% test coverage required

Other resources to learn from