13
SL-api Node.js wrapper för SLs API:er github.com/simon-johansson/SL-api

SL-api - node.js wrapper för SLs API:er

Embed Size (px)

Citation preview

Page 1: SL-api - node.js wrapper för SLs API:er

SL-apiNode.js wrapper för SLs API:er

github.com/simon-johansson/SL-api

Page 2: SL-api - node.js wrapper för SLs API:er

Simon JohanssonInteraktionsdesigner & Webbutvecklare

Page 3: SL-api - node.js wrapper för SLs API:er

API:er

SL Realtidsinformation 3

SL Platsuppslag

SL Reseplanerare 2

SL Trafikläget 2

SL Störningsinformation 2

Page 4: SL-api - node.js wrapper för SLs API:er

Varför bör man använda modulen?

Underlättar nyttjande av API:erna:

● Färre rader kod krävs

● Mer semantisk kod

● Response-data snyggare och konsekvent

Page 5: SL-api - node.js wrapper för SLs API:er
Page 6: SL-api - node.js wrapper för SLs API:er

Med modulen

Page 7: SL-api - node.js wrapper för SLs API:er

Instansering

Page 8: SL-api - node.js wrapper för SLs API:er

Callback

Promise

Page 9: SL-api - node.js wrapper för SLs API:er

Promise chaining

Page 10: SL-api - node.js wrapper för SLs API:er
Page 11: SL-api - node.js wrapper för SLs API:er
Page 12: SL-api - node.js wrapper för SLs API:er

SLs API:er borde:

● Tillåta JSON-P eller CORS

● Endast kräva en API-nyckel...

● …eller ingen nyckel överhuvudtaget

● Leverera konsekvent data