sails 11 の変更点

イシュー

  • sails 11 で sails.io が読み込まれないと思ったら、デフォルトでは読み込まないように変更されているとのこと。
  • 他にも変更点を確認する。

参考

Release announce

What's in v0.11?

v0.11とは何か?

v0.11 comes with many minor improvements, as well as some internal cleanup in core. But the biggest changes are that Sails core now (1) allows hooks (aka plugins) to be injected simply by installing them from NPM and (2) supports Socket.io v1.0.

v0.11は、多くのマイナーな改良だけでなく、コア内のいくつかの内部クリーンアップを含んでいます。しかし、最大の変更は、Sailsのコアは今、NPMインストールによるシンプルな注入であるフック(別名プラグイン)を可能にしたことです(1)。そして Socket.io v1.0をサポートしました(2)。

A few hooks that might be of interest:

• sails-hook-autoreload - Reloads controllers and models without you having to restart the server. • sails-hook-dev - Provides diagnostic / debugging information during development. • sails-hook-machines - Allows you to import machines from your api/machines folder and use them in your Sails app. This is useful as a more structured alternative to writing custom model methods and/or services.

興味があるかもしれない いくつかのフック:

•sails-hook-autoreload - あなたは、サーバーを再起動することなく、コントローラとモデルをリロードできます。 •sails-hook-dev - 開発時に診断/デバッグ情報を提供します。 •sails-hook-machines - あなたのAPI またはマシンフォルダからマシンをインポートして、Sailsアプリでそれらを使用することができます。これは、カスタムモデルのメソッドおよび/またはサービスを書くためのより構造的な代替の手段として有用です。

hooks

sails.io.js

hook の使い方

hookの呼び出し方

  • Sails.js | Realtime MVC Framework for Node.js

    Any methods that a hook exposes are available in the sails.hooks[<hook-name>] object. For example, the sails-hook-email hook provides a sails.hooks.email.send() method (note that the sails-hook- prefix is stripped off). Consult a hook’s documentation to determine which methods it provides.