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

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

Jul 30, 2015

Download

Technology

Simon Johansson
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
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