2016-07-23 33 views
0

即時通訊嘗試使用快遞生成器製作包含節點和快遞的應用程序,並用node-webkit封裝所有內容。 express生成器創建一個非常基本的應用程序,但它運行npm start localhost:30000。如何使節點Webkit與快遞生成器一起工作

清單

{ 
    "name": "app", 
    "version": "0.0.0", 
    "private": true, 
    "node-main": "./app.js", 
    "main": "http://localhost:8080", 
    "scripts": { 
    "start": "node ./bin/www" 
    }, 
    "dependencies": { 
    "body-parser": "~1.15.1", 
    "bower": "^1.7.9", 
    "cookie-parser": "~1.4.3", 
    "debug": "~2.2.0", 
    "express": "~4.13.4", 
    "morgan": "~1.7.0", 
    "pug": "^2.0.0-beta4", 
    "serve-favicon": "~2.3.0" 
    } 
} 

的文件夾結構 Folder strcture

當我運行nwjs應用程序的窗口顯示該頁面無法加載,但控制檯不顯示任何錯誤。我試圖改變

「主」:「http://localhost:8080」爲「主」:「http://localhost:3000

這是怎麼應用程序通常運行,但它沒有工作,要麼。

enter image description here

這可能嗎? 我在想什麼?

在此先感謝

回答

0

這可能有點晚,但無論如何。 這裏是來源:https://github.com/nwjs/nw.js/wiki/NW.js-use-express-and-similar-web-frameworks

node-main應該有文件路徑,它建立了服務器。在這種情況下,我假設它位於bin目錄中並命名爲www。因此,package.json應該是這樣的:

{ 
... 
"node-main": "./bin/www", 
"main": "http://localhost:3000", 
... 
} 

還檢查端口號,如果它是3000或其他東西。

相關問題