loopback/README.md

62 lines
972 B
Markdown
Raw Normal View History

2013-04-09 16:02:36 +00:00
# asteroid
2013-06-07 20:09:07 +00:00
v0.6.0
2013-04-09 16:02:36 +00:00
## Install
2013-04-09 18:33:29 +00:00
slnode install asteroid -g
2013-04-26 18:44:19 +00:00
## API
### app
Create an asteroid app.
var asteroid = require('asteroid')
, app = asteroid();
### app.dataSource()
Attach a remote data source to your app.
app.dataSource('color-db', {
adapter: 'oracle',
host: 'localhost',
port: 2345,
user: 'test',
password: 'test'
});
### app.define(name)
Define a [Model](node_modules/model).
var Color = app.define('color');
### app.use(asteroid.rest);
Expose your models over a REST api.
// node
app.use(asteroid.rest);
// http
GET /colors
200 OK
[
{name: 'red'},
{name: 'blue'},
{name: 'green'}
]
2013-04-09 16:02:36 +00:00
2013-04-26 17:10:10 +00:00
## Asteroid Modules
2013-04-09 16:02:36 +00:00
2013-04-26 17:10:10 +00:00
- [Asteroid Module Base Class](node_modules/asteroid-module)
- [Route](node_modules/route)
- [Model Route](node_modules/model-route)
- [Model](node_modules/model)
2013-05-20 21:31:04 +00:00
- [Data Source](node_modules/data-source)