Node & Express Again

 

Leon Noel

#100Devs

I ain't know nothin' 'bout no Visa, I was in the park with the gang
Moms be feelin' bad, I try to tell her she is not to blame
No social security, couldn't get a license, but I still didn't complain

Agenda

  • Questions? 

  • Let's Talk -  #100Devs

  • Review - Event Loop 

  • Learn - CRUD

  • Learn - Express

  • Learn - Build your own API 

  • Homework - Build your own API

Questions

About last class or life

Checking In

Like and Retweet the Tweet

!checkin

Live CAR Class

FRIDAY
6:00pm EST

And we are talking about the agency

Office Hours

SUNDAY
1:00pm EST

Networking

1 coffee chat this week

USE THE SHEET!

NOW WITH TWO TABS!: Google Sheet

Grab The Checklist

!checklist

PUSH EVERY DAY

Express

But First

Blast To The Past

How Does The Internet Work

CRUD

Create (post) - Make something

Read (get) - Get Something

Update (put) - Change something

Delete (delete) - Remove something

Instagram

What are some Create (post) requests?

Instagram

What are some Read (get) requests?

Instagram

What are some Update (put) requests?

Instagram

What are some Delete (delete) requests?

Coffee Chat & Professional Review

Let's Build An App with Express

Express

Fast, unopinionated, minimalist web framework for Node.js

 

With a myriad of HTTP utility methods and middleware at your disposal, creating a robust API is quick and easy.

TONIGHT WE BUILD

Key Steps

mkdir api-project
cd api-project
npm init 
npm install express --save

Setting Up The Project

app.get('/', (req, res) => {
  res.sendFile(__dirname + '/index.html')
})

Serving Up HTML

app.get('/api/savage', (request, response) => {
  response.json(object)
})

Serving Up JSON

heroku login -i
heroku create simple-rap-api
echo "web: node server.js" > Procfile
git add . 
git commit -m "changes"
git push heroku main

Push To Heroku

Homework

 

Do: Start prepping THE BANK

Do: Complete Your Professional Links

Create: Heroku, Mongo Atlas, and Postman Accounts

Read: Node.js and Express (Fullstack Open)

Do: Make Your Own API and Push To Heroku