$ npm install -g strongloop
$ slc loopback
_-----_
| | .--------------------------.
|--(o)--| | Let's create a LoopBack |
`---------´ | application! |
( _´U`_ ) '--------------------------'
/___A___\
| ~ |
__'.___.'__
´ ` |° ´ Y `
[?] What's the name of your application? loopback-getting-started
[?] Enter name of the directory to contain the project: loopback-getting-started
$ cd loopback-getting-started
$ slc loopback:model
[?] Enter the model name: people
[?] Select the data-source to attach people to: db (memory)
[?] Select model's base class PersistedModel
[?] Expose people via the REST API? Yes
[?] Custom plural form (used to build REST URL):
[?] Common model or server only? common
Let's add some people properties now.
Enter an empty property name when done.
[?] Property name: firstname
invoke loopback:property
[?] Property type: string
[?] Required? Yes
Let's add another people property.
Enter an empty property name when done.
[?] Property name: lastname
invoke loopback:property
[?] Property type: string
[?] Required? Yes
Let's add another people property.
Enter an empty property name when done.
$ slc loopback:model
[?] Enter the model name: CoffeeShop
[?] Select the data-source to attach CoffeeShop to: db (memory)
[?] Select model's base class PersistedModel
[?] Expose CoffeeShop via the REST API? Yes
[?] Custom plural form (used to build REST URL):
[?] Common model or server only? common
Let's add some CoffeeShop properties now.
Enter an empty property name when done.
[?] Property name: name
invoke loopback:property
[?] Property type: string
[?] Required? Yes
Let's add another CoffeeShop property.
Enter an empty property name when done.
[?] Property name: city
invoke loopback:property
[?] Property type: string
v Required? Yes
Let's add another CoffeeShop property.
Enter an empty property name when done.
[?] Property name:
$ node .
Web server listening at: http://0.0.0.0:3000
Browse your REST API at http://0.0.0.0:3000/explorer