Express-Override
Express の拡張プラグインです。(Version2.5.x & 3.x.x) Expressをベースに新たにフレームワークを作成するのではなく、Expressのまま使用する為の最低限のライブラリ群です。 現在のバージョン0.1.xでは、
- routesで実行するモジュールのファイル分割 (handlers)
- 全handlersで使用出来るグローバルオブジェクトの提供
- klass.js の使用によるhandlers/modelsの継承
のみの機能です。
Installation
基本仕様はexpressコマンドにより、アプリケーションのベースファイルが作成された後に実行される事を想定しています。 eorコマンドの引数にはexpressコマンドの引数と同じ物を指定すると、sampleファイルがすぐに使用出来る様になります。
$ npm install -g express-override
Quick Start
Initialize
$ eor [same options]
$ npm install -d
or
$ eor [same options]
$ npm install express-override
Run
$ node eor-sample-app.js
Browser
http://localhost:3000
http://localhost:3000/hello
Other
Expressのバージョンを指定する事でサンプルファイル(eor-sample-app.js)をExpressのバージョンに合わせて作成します。 デフォルトではVersion2。
$ eor -x 2
OR
$ oer -x 3
Example
/handlers/SampleHandlers.js
module{return eor};
/models/SampleModel.js
module{return eor;};
今後のアップデート方針
Expressを使用したアプリケーションで車輪の再開発を防ぐ事を目的としたscaffold機能や、 Expressのバージョン互換吸収等を目的に更新して行きます。