Fetch Url Then Parse Then Handle Catch
Example:
Given two integers a and b, which can be positive or negative, find the sum of all the numbers between including them too and return it. If the two numbers are equal return a or b. | |
Note: a and b are not ordered! | |
Examples | |
GetSum(1, 0) == 1 // 1 + 0 = 1 | |
GetSum(1, 2) == 3 // 1 + 2 = 3 | |
GetSum(0, 1) == 1 // 0 + 1 = 1 | |
GetSum(1, 1) == 1 // 1 Since both are same | |
GetSum(-1, 0) == -1 // -1 + 0 = -1 |
Fetch Url Then Parse Then Handle Catch
Example:
// Objective - Describe and implement the following native array methods: | |
// forEach, some, every, filter, map, and reduce. | |
// FOREACH | |
// There are a number of helpful functions built-in | |
// to JavaScript's regular arrays. These methods | |
// are both higher order functions and **functional** | |
// in that they do not manipulate the array they | |
// are working on. That is, they are non-destructive. |
Link for mapping over an array and creating an UL and understanding keys https://reactjs.org/docs/lists-and-keys.html
Express
intro to Express with CJ: https://youtu.be/0jxFHnNVbbc
Node.js Express JSON API - CRUD Stickers We'll be using:
Postgres for our database
knex.js for our database migrations, seeds and queries.
express.js for our JSON routes
Mocha, Chai and SuperTest to test our routes
What does MERN stand for? MongoDB, Express, React, Node.js Start with backend npm init in empty directory change entry point to server.js in package.json
Install dependencies npm i express body-parser mongoose concurrently npm i -D nodemon
You will need a git repo on the hub before doing this... of course
From server directory:
$ heroku create $ git push heroku master
To display logs for Heroku, use the following command: $ heroku logs --tail