Skip to content

Latest commit

 

History

History
79 lines (35 loc) · 1.77 KB

README.md

File metadata and controls

79 lines (35 loc) · 1.77 KB

Teaching Node

Web Fundamentals

Objectives
Compare and contrast parallels between teaching Rails and Express
Answer questions related to teaching JS first curriculum.

Typical Files Of Interest

In a Rails application we would typically have a few main files to discuss when teaching CRUD to students.

  • config/routes.rb
  • controllers/todo_controller.rb
  • views/*.html.erb
  • models/todo.rb
  • Gemfile

In a very simple Express CRUD application we have most the routing and control logic in a single application file, similar to a Sinatra application. However, we still have a large number of parallels.

  • models/todo.js
  • views/*.ejs
  • app.js
  • package.json

Models

With Rails ActiveRecord gives us both a migration system and a modeling system for our database. In the node world the existing solution for this is Sequelize, which is not without it's faults, but gets the job done.

Views (EJS)

EJS is remarkably similar to ERB, and is great way to prepare them for working with ERB.

Express Setup

Express is relatively simple API to fiddle with and teach to students.

Current SF WDI Instance

Other Resources