sails README

The project's README from github.com/balderdashy/sails. As one markdown file: README.md.

Sails.js

Website   Get Started   Docs   News   Submit Issue

NPM version   Gitter   Twitter Follow

Sails.js is a web framework that makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app & API development. It's especially good for building realtime features like chat.

Since version 1.0, Sails supports await out of the box. This replaces nested callbacks (and the commensurate error handling) with simple, familiar usage:

var orgs = await Organization.find();

Installation  

With node installed:

# Get the latest stable release of Sails
$ npm install sails -g
Upgrading from an earlier version of Sails?

Upgrade guides for all major releases since 2013 are available on the Sails website under Upgrading.

Your First Sails Project

Create a new app:

# Create the app
sails new my-app

Lift sails:

# cd into the new folder
cd my-app

# fire up the server
sails lift

Screenshot from the original Sails video

For the most up-to-date introduction to Sails, get started here.

Compatibility

Sails is built on Node.js, Express, and Socket.io.

Sails actions are compatible with Connect middleware, so in most cases, you can paste code into Sails from an existing Express project and everything will work-- plus you'll be able to use WebSockets to talk to your API, and vice versa.

The ORM, Waterline, has a well-defined adapter system for supporting all kinds of datastores. Officially supported databases include MySQL, PostgreSQL, MongoDB, Redis, and local disk / memory. Community adapters exist for CouchDB, neDB, SQLite, Oracle, MSSQL, DB2, ElasticSearch, Riak, neo4j, OrientDB, Amazon RDS, DynamoDB, Azure Tables, RethinkDB and Solr; for various 3rd-party REST APIs like Quickbooks, Yelp, and Twitter, including a configurable generic REST API adapter; plus some eclectic projects.

Powered by MySQL                                

For the latest core adapters and notable community adapters, see Available Adapters.

Tutorial Course

Books

Support

Need help or have a question?

Issue submission

Please read the submission guidelines and code of conduct before opening a new issue. Click here to search/post issues in this repository.

Contribute

There are many different ways you can contribute to Sails:

Please carefully read our contribution guide and check the build status for the relevant branch before submitting a pull request with code changes.

Team

Sails is actively maintained with the help of many amazing contributors. Our core team consists of:

Mike McNeil Kelvin Omereshone Eric Shaw
Mike McNeil Kelvin Omereshone Eric Shaw

Our company designs/builds Node.js websites and apps for startups and enterprise customers. After building a few applications and taking them into production, we realized that the Node.js development landscape was very much still the Wild West. Over time, after trying lots of different methodologies, we decided to crystallize all of our best practices into this framework. Six years later, Sails is now one of the most widely-used web application frameworks in the world. I hope it saves you some time! :)

License

MIT License Copyright © 2012-present, Mike McNeil

Sails is built around so many great open-source technologies that it would never have crossed our minds to keep it proprietary. We owe huge gratitude and props to Ryan Dahl (@ry), TJ Holowaychuk (@tj), Doug Wilson (@dougwilson) and Guillermo Rauch (@rauchg) for the work they've done, as well as the stewards of all the other open-source modules we use. Sails could never have been developed without your tremendous contributions to the JavaScript community.

A squid peering inside a book, halation and cosmic Sails.js knowledge emanating from the pages of the substantial tome

sails (balderdashy/sails)

Searching Database…

22.8K ·GitHub
这是什么?Sails.js 是一个用于 Node.js 的实时 MVC 网页框架,旨在让人们更容易构建定制化的企业级应用和 API,其结构借鉴了 Ruby on Rails。
它是框架还是库?它是一个完整的框架:提供应用结构、CLI 代码生成器、路由和 ORM,而不只是一组需要导入的工具函数。
我该如何让它运行起来?安装 Node,然后使用 Sails CLI 创建一个新应用,并用 'lift'(启动)命令启动服务器。
使用之前需要先安装什么吗?只需要 Node.js(0.10.0 或更高版本)和 npm;Sails 本身以 npm 包的形式发布,基于 Express 和 Socket.io 构建。
在不同版本之间升级容易吗?不会自动完成——在大版本之间跳转,需要参考 Sails 官网自 2013 年起发布的专门升级指南。
我能复用现有的 Express 代码吗?可以——Sails 的 action(动作)与 Connect 中间件兼容,因此大多数现有 Express 项目代码可以直接粘贴使用,同时还额外支持 WebSocket。
Sails 开箱即支持哪些数据库?官方支持的适配器包括 MySQL、PostgreSQL、MongoDB、Redis,以及本地磁盘/内存,均通过其内置的 ORM Waterline 连接。社区适配器还可扩展支持 CouchDB、SQLite、Oracle、MSSQL、DynamoDB、ElasticSearch 等更多数据库。
它支持聊天之类的实时功能吗?支持。Sails 基于 Socket.io 与 Express 构建,因此除常规 HTTP 外,还可以使用 WebSocket 与 API 通信,特别适合聊天等实时功能。
我需要编写大量回调代码吗?不需要——从 1.0 版本开始,Sails 开箱即支持 async/await,用更简单、熟悉的语法取代了嵌套回调及其错误处理。
为什么要创建 Sails,而不直接用 Express?创作者为初创公司和企业开发过 Node.js 应用,发现这一生态缺乏约定规范,于是将从众多项目中提炼出的最佳实践,整合成这个基于 Express 和 Socket.io 的 MVC 风格框架。
What are similar projects?carno.js, Perfect, fiber, iris, node-restify, express, koa, hapi
Size
12.9 MB
Stars
22.8K
Age
14y
Commits · 90 Days