Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Loopback presentation by tineco

508 visualizaciones

Publicado el

How create a REST API for IOT

Publicado en: Software
  • Sé el primero en comentar

Loopback presentation by tineco

  1. 1. stephane.guilly@gmail.com https://twitter.com/stephaneguilly https://www.linkedin.com/in/stephaneguilly http://www.ido4pro.com http://www.checkcarfleet.com
  2. 2. DEVELOPER FOR MORE THAN 30 YEARS
  3. 3. Web Application Framework for Tineco ?
  4. 4. Most of the modules and the ‘core’ use MIT licence
  5. 5. Additional professional services
  6. 6. DEMO
  7. 7. POST { “chipId” : “C0001”, “flashId” : “F0001” } { “id” : “54787800001” }
  8. 8. GET devices [{ “id”: “54787800001” “chipId” : “C0001”, “flashId” : “F0001”, “creationDate” : “2016-09-27T00:00:00.021Z” }]
  9. 9. LOOPBACK PROJECT
  10. 10. $ npm install -g strongloop $ slc loopback
  11. 11. $ slc loopback:model
  12. 12. only 2 files to describe a model json file : describe your model
  13. 13. $ slc loopback:export-api-def --o swagger.yml reuse models in swagger tools
  14. 14. DATASOURCE
  15. 15. install a connector for your favorite database (loopback has a lot of connectors) config it with the C.L.I
  16. 16. REMOTE METHOD
  17. 17. remember only 2 files to describe a model js file : add logic to your model
  18. 18. “Not RE-INVENT THE WHELL” : CRUD logic is already add to your model
  19. 19. Forget database syntax : use the simple filter JSON object syntax
  20. 20. REMOTE HOOK
  21. 21. MIXIN
  22. 22. Apply same logic for several models
  23. 23. BOOT
  24. 24. Wait end of this script before run the next one with ‘cb’ parameter
  25. 25. Run other scripts in parallel (no ‘cb’
  26. 26. MIDDLEWARE
  27. 27. ACL
  28. 28. remember only 2 files to describe a model
  29. 29. Create User and use User.login with username/email and password to obtain a token
  30. 30. Use this token to pass ACL
  31. 31. Paste token here
  32. 32. Loopback is more powerful than just create an simple API server !
  33. 33. CLIENT SDK
  34. 34. $ lb-ng ../server/server.js js/lb-services.js
  35. 35. Add the lbServices module create by the previous step in your angular app Use all your model in your controller/service just by adding their name loopback angular client use ngResource. Don’t forget to install it !
  36. 36. THANKS

×