Loopback presentation by tineco

Preview:

Citation preview

stephane.guilly@gmail.com

https://twitter.com/stephaneguilly

https://www.linkedin.com/in/stephaneguilly

http://www.ido4pro.com

http://www.checkcarfleet.com

DEVELOPER FOR MORE

THAN 30 YEARS

Web Application Framework for Tineco ?

Most of the modules and the ‘core’ use MIT licence

Additional professional services

DEMO

POST{

“chipId” : “C0001”,“flashId” : “F0001”

}

{ “id” : “54787800001”}

GET devices[{

“id”: “54787800001”“chipId” : “C0001”,“flashId” : “F0001”,“creationDate” : “2016-09-27T00:00:00.021Z”

}]

LOOPBACK PROJECT

$ npm install -g strongloop

$ slc loopback

$ slc loopback:model

only 2 files to describe a model

json file : describe your model

$ slc loopback:export-api-def --o swagger.yml reuse models in swagger tools

DATASOURCE

install a connector for your favorite database (loopback has a lot of connectors)

config it with the C.L.I

REMOTE METHOD

remember only 2 files to describe a model

js file : add logic to your model

“Not RE-INVENT THE WHELL” : CRUD logic is already add to your model

Forget database syntax : use the simple filter JSON object syntax

REMOTE HOOK

MIXIN

Apply same logic for several models

BOOT

Wait end of this script before run the next one with ‘cb’ parameter

Run other scripts in parallel (no ‘cb’

MIDDLEWARE

ACL

remember only 2 files to describe a model

Create User and use User.login with username/email and password to obtain a token

Use this token to pass ACL

Paste token here

Loopback is more powerful than just create

an simple API server !

CLIENT SDK

$ lb-ng ../server/server.js js/lb-services.js

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 !

THANKS

Recommended