Skip to content

Instantly share code, notes, and snippets.

View micahwierenga's full-sized avatar
💭
Learning

Micah Wierenga micahwierenga

💭
Learning
View GitHub Profile

Mongoose Flights Lab, Part 3: Supplement

These clarifications and wireframes are meant to be a supplement to Mongoose Flights Lab, Part 3.

The Ticket Schema

First, you're to create a Ticket schema with the following fields/properties:

  • seat
  • price

OAuth: Understanding the Logical Order

There are a few different processes that we need to understand when it comes to OAuth: 1) What happens when the server starts, 2) What happens when an authentication request is handled, and 3) What happens when a normal route with authorization is handled. We won't be writing code in this order, but these lists will help you understand their part in the processes.

When the Server Starts

  1. Load express-session and passport libraries.

In server.js:

OAuth: Understanding the Logical Order

There are a few different processes that we need to understand when it comes to OAuth: 1) What happens when the server starts, 2) What happens when an authentication request is handled, and 3) What happens when a normal route with authorization is handled. We won't be writing code in this order, but these lists will help you understand their part in the processes.

When the Server Starts

  1. Load express-session and passport libraries in server.js:

    Code

Creating a Library App

Setup

  1. cd ~/code
  2. express -e library-app
  3. cd library-app
  4. npm i
  5. npm i mongoose
  6. Rename app.js to server.js

Big-O Notation Exercises

What is the worst-case time complexity for the following algorithms?

#1

function wordOccurrence(word, phrase){
  let result = 0
  const array  = phrase.split(' ')
@micahwierenga
micahwierenga / static_site_s3_route_53_lab.md
Last active February 21, 2024 01:35
Static Websites and Custom Domains Using Amazon S3 and Amazon Route 53

Static Websites and Custom Domains Using S3 and Route 53

You have a website that needs to display a few images, as well as your content. It doesn't need to collect user data like their names, email, and password, nor does it need to upload profile images. It's simple, which is why this lab will show you how to use Amazon Simple Storage Service (S3) to host your site.

You also have a custom domain that you want to use for this website. Once we've hosted your site on S3, we'll use Amazon Route 53 to ensure that users can find it using your chosen domain.

In order to acquire these skills, we're going to build a pet adoption site that displays some text and a few images. Then we're going to route a custom domain to this website in order to make it easier for users to discover your site.

Contents