js concepts and api

87
Day 2 Across The Tiers with Express.js  JS Concept s  & APIs

Upload: danielz

Post on 01-Jun-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 1/87

Day 2 Across The Tiers with Express.js JS Concepts & APIs

Page 2: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 2/87

File System

I/O

Page 3: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 3/87

Node APIs

File System

I/O

Page 4: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 4/87

Node APIs

Patterns for ManagingAsync

File System

I/O

Page 5: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 5/87

ccessing DataSources

Node APIs

Patterns for ManagingAsync

File System

I/O

Page 6: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 6/87

ccessing DataSources

rchitecture

Node APIs

Patterns for ManagingAsync

File System

I/O

Page 7: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 7/87

ccessing DataSources

Express!sFrame"or# 

rchitecture

Node APIs

Patterns for ManagingAsync

File System

I/O

Page 8: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 8/87

ccessing DataSources

Express!sFrame"or# 

$ES%ful API

rchitecture

Node APIs

Patterns for ManagingAsync

File System

I/O

Page 9: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 9/87

Filesystem I!

Page 10: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 10/87

Filesytem " #asic I!

Page 11: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 11/87

Filesystem " Synchrono$s %s. Asynchrono$s

Page 12: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 12/87

Filesystem " Synchrono$s %s. Asynchrono$s

Page 13: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 13/87

how"to sample

Page 14: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 14/87

For & Answer '$estionsDay 2 '$i( )

Page 15: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 15/87

Async Patterns

Page 16: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 16/87

Call*acs

Page 17: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 17/87

+o,e API " Call*acs

Page 18: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 18/87

+o,e API " Call*acs

Page 19: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 19/87

+o,e API " Call*acs

Page 20: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 20/87

+o,e API " Call*acs- The +o,e ay

Page 21: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 21/87

+o,e API " Call*acs- The +o,e ay

Page 22: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 22/87

Promises

Page 23: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 23/87

/$l0lle,

&

pen,in1'

(

rejecte,

settle,)

Page 24: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 24/87

+o,e API " Promises Instantiation

Page 25: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 25/87

+o,e API " Promises sa1e

Page 26: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 26/87

how"to sample

Page 27: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 27/87

For & Answer '$estionsDay 2 '$i( 2

Page 28: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 28/87

+o,e APIs

Page 29: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 29/87

+o,e API " E%ent Emitter

Page 30: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 30/87

SSE or Ser%er Sent E%ents

p$sh noti0cations

Page 31: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 31/87

e* Socets

we* socets

Page 32: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 32/87

realtime /ramewor

prim$s

Page 33: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 33/87

+o,e API " Socet.io

Page 34: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 34/87

#$3ers

Page 35: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 35/87

4anip$lates- creates-an, cons$mes octetstreams.

5aw ,ata is store, ininstances o/ the#$3er Class.

 Ja%aScript ,oesn6tspea *inary ,ata.

 TCP Streams

Filesystem

#$3ers

Page 36: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 36/87

new #$3er7si(e8

&

new #$3er7*$3er8'

(

new #$3er7array8

new #$3er7str9- enco,in1:8)

Page 37: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 37/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

/or ; *it ASCII ,ata only. This enco,in1metho, is %ery /ast- an, will strip the

hi1h *it i/ set.

Page 38: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 38/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

4$lti*yte enco,e, nico,e characters.4any we* pa1es an, other ,oc$ment/ormats $se TF"<.

Page 39: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 39/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

2 or = *ytes- little en,ian enco,e,nico,e characters. S$rro1ate pairs7>)???? to >)?FFFF8 ares$pporte,.

Page 40: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 40/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

Alias o/ @$t/)le@.

Page 41: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 41/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

#ase= strin1 enco,in1.

Page 42: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 42/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

A way o/ enco,in1 raw *inary ,ata intostrin1s *y $sin1 only the 0rst < *its o/each character. This enco,in1 metho,

is ,eprecate, an, sho$l, *e a%oi,e, in/a%or o/ #$3er o*jects where possi*le.This encoding will be removed infuture versions of Node.

Page 43: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 43/87

*ucs&*

*+inar**hex*

*+ase,)*

*utf-**utf(,le*

*ascii*

Enco,e each *yte as twohexa,ecimal characters.

Page 44: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 44/87

Streams

Page 45: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 45/87

+o,e API " Streams

Page 46: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 46/87

+o,e API " Streams

Page 47: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 47/87

+o,e API " Streams

Page 48: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 48/87

how"to sample

Page 49: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 49/87

For & Answer '$estionsDay 2 '$i( B

Page 50: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 50/87

Data So$rces

Page 51: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 51/87

Connectors & So$rces

Page 52: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 52/87

how"to sample

Page 53: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 53/87

Alternates A..A. +oS'

,ata str$ct$res

Page 54: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 54/87

#ey/.alue

Page 55: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 55/87

graph

Page 56: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 56/87

time series

Page 57: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 57/87

,ata*ase architect$re

Page 58: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 58/87

For & Answer '$estionsDay 2 '$i( =

Page 59: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 59/87

Architect$re

Page 60: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 60/87

e%ent loop

Page 61: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 61/87

no,e cl$sterin1

Page 62: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 62/87

4an$ally

oa, #alancin1

Page 63: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 63/87

AS Example

oa, #alancin1

Page 64: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 64/87

AS Example Expan,e,

oa, #alancin1

Page 65: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 65/87

Page 66: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 66/87

A$tomate, Testin1

Page 67: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 67/87

4essa1e '$e$es & Cache Ser%ices

Page 68: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 68/87

+o,e.js 4i,,leware Pattern

Page 69: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 69/87

how"to sample

Page 70: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 70/87

For & Answer '$estionsDay 2 '$i(

Page 71: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 71/87

ExpressFramewor

Page 72: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 72/87

4o,el

4C

Controlleriew

Page 73: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 73/87

SPAs

&

(

APIs

Page 74: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 74/87

Express.js " Installin1 & Project Set$p

Page 75: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 75/87

Express.js " Application Generator

Page 76: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 76/87

Express.js " Application Generator

Page 77: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 77/87

Express.js " Application Generator

Page 78: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 78/87

how"to sample

Page 79: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 79/87

For & Answer '$estionsDay 2 '$i(

Page 80: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 80/87

5EST/$l APIs

hat is an APIH

Page 81: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 81/87

In we* parlance an API is a simple inter/acethat will per/orm a partic$lar action.

Ser%ice !riente, Architect$re o/ten comes tomin, with the correlation to micro"ser%icesan, relate, API ,ri%en ,esi1n i,eas.

hat is an APIH

S!A 5e%isite,H

Page 82: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 82/87

TTP er*s

Page 83: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 83/87

GET

&

PT'

(

P!ST

PDATE'

Page 84: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 84/87

En, Points

Page 85: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 85/87

P% /tic#ets/(& 0 pdates tic#et1(&

DE2E%E /tic#ets/(& 0 Deletes tic#et1(&

PA%34 /tic#ets/(& 0 Partially updatesic#et 1(&

5E% /tic#ets/(& 0 $etrie.es a speci6cic#et

POS% /tic#ets 0 3reates a ne"

ic#et

5E% /tic#ets 0 $etrie.es a list of

ic#ets

Page 86: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 86/87

how"to sample

Page 87: JS Concepts and API

8/8/2019 JS Concepts and API

http://slidepdf.com/reader/full/js-concepts-and-api 87/87

For & Answer '$estionsDay 2 '$i( ;