Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 3.34 KB

express-lab-exercise.md

File metadata and controls

57 lines (40 loc) · 3.34 KB

Express.js

Languages

  • JavaScript

Frameworks

  • Node.js
  • Express.js

Topics

  1. How to create a web app with Express.js
  2. The MVC framework

Overview

In this lab exercise, you will use a Node.js server and the Express.js web framework to build a web application.

Context

  • We know how to run a server using Node.js
  • We have static HTML, CSS & JavaScript files we need to render in a Browser
  • Express.js allows us to serve these static files to the Browser using Node.js

Basic Requirements

  1. Apprentices will obtain a code review where specified in the instructions.

Setup Instructions

Use the Terminal for navigating around the file system and creating new folders and files. Refer to the lesson on Shell Commands if you need guidance on using the Terminal.

When you get to the steps below that ask you to initialize a git repo and track files using git, refer to the lesson on Git and Version Control if you need guidance.

Navigate to the techtonica-labs folder located in your Desktop. Create a new folder called getting-started-with-node within the techtonica-labs folder. Navigate to getting-started-with-node. Initialize getting-started-with-node as a git repository.

If you have questions, do not disturb other pairs until you have spent 15-20 minutes troubleshooting within your own pair. Post a message on the #help channel in Slack if you and your pair partner are still stuck after 15-20 minutes. Be sure to format your question using the template we practiced in the Asking Good Questions lesson.

Lab Instructions

Starter Code

There is no starter code for this lab exercise.

Lab Exercise

  1. Watch this video tutorial in its entirety. You will see how a web app is made with Express.js. Do not write any code during this step, just watch the video. It is long, at 1 hour and 15 minutes, but it is a good investment of time because by simply watching the video the first time through, you will have absorbed more details than if you jumped straight into coding.

  2. Watch the video tutorial again, this time following along with the video. You will probably need to pause the video many times in order to duplicate the steps the instructor is showing.

  3. Be prepared for a code review approximately every 30 minutes. Send your Techtonica Facilitator a screenshot of your progress with the video tutorial and or of any questions you have.

Questions to Consider

  • Ask questions here that connect what is being done in the lab exercise to what was covered in the associated lecture.
  • Also ask questions that connect this lab exercise to prior lessons.
  • Also ask questions that require the apprentice to put together multiple pieces of knowledge to arrive at an answer or opinion.

Extensions

  • Add more HTML views and routes to your Express.js app.
  • Create a blog-based website where you can write, edit and publish posts.
  • Create a mock shopping cart website where a user can browse inventory, add items to their cart, and reduce the inventory count for an item when they "purchase" it.