0

I'm using appjs (with nodejs + chromium) in my desktop app. I need to include js files and call functions defined in those files in my app.js file (mainly in menu created using app.createMenu(..) ). So I tried to include the files using the below code given in http://appjs.org/, http://comments.gmane.org/gmane.comp.lang.javascript.nodejs/45736, but it's not working:

var appjs = require('appjs');

// serve static files from a directory
appjs.serveFilesFrom(__dirname + '/content');

Is there anything else need to be added to make this code working? Please help me.

Thanks in advance.

4

1 に答える 1

0

.serveFilesFrom()contentディレクトリ内の静的アセットを提供するだけです。静的とは、CSS、HTML、画像、およびクライアント側のJavaScript を意味します。

リクエストと依存関係の管理を自分で処理する必要があります。ただし、これは理解するのに十分簡単です。

これを行う良い方法は、AppJS ホームページで入手可能な既存のスターター パッケージ配布可能ファイルの 1 つを使用してアプリの開発を開始することです (オペレーティング システムに適したものを選択してください)。あなたのために書かれたコードと設定。

于 2013-02-18T10:05:21.107 に答える