sails-types/README.md

23 lines
1.2 KiB
Markdown
Raw Normal View History

2016-12-08 12:36:26 +01:00
# (WIP) Typescript definitions for the [sails.js](https://github.com/balderdashy/sails) web framework.
_forked from [Alex Clavelle's github repository](https://github.com/aclave1/sails-types)_
2015-03-21 23:21:19 +01:00
2016-12-08 12:36:26 +01:00
## Overview
2015-03-21 23:21:19 +01:00
sails.js is a node.js mvc web framework. The two main pieces of a sails app are the Models, and Controllers. The views can be interchanged between multiple view engines. They aren't sails specific so don't require any type mappings.
2016-12-08 12:36:26 +01:00
## Requirements
2015-03-21 23:27:18 +01:00
Requires the express,bluebird, and socket.io type mappings. Eventually, we'll merge this with definitely typed and use tsd, but for now, just install everything manually.
2015-03-21 23:21:19 +01:00
2016-12-08 12:36:26 +01:00
## Controllers
2015-03-21 23:21:19 +01:00
Each controller action is passed two parameters,an express request object, and an express response object. The request and response objects have been extended by the sails framework to add custom functionality. The main controller type definitions are for the extensions to the request and response objects.
2016-12-08 12:36:26 +01:00
## Models
2015-03-21 23:21:19 +01:00
A sails Model is a static class with methods like create, update, and find which correspond to operations on the database. These operations return Records.
Records: A record corresponds to a single row in the database.
2016-12-08 12:36:26 +01:00
## Usage
2015-03-21 23:27:18 +01:00
todo
2015-03-21 23:21:19 +01:00
2016-12-08 12:36:26 +01:00
## Mappings
2015-03-21 23:21:19 +01:00
todo, check the code