簡體   English   中英

通過nodejs socket.io服務PHP

[英]Serve PHP through nodejs socket.io

我在我的應用程序中同時運行nodejs和php,但只能使用一個端口。 因此,我想做的是使nodejs成為端口上的用戶,然后通過路由將index.php給予用戶,例如:

app.get("index.php") 

有誰知道我該怎么做嗎? 非常感謝你...

您可以嘗試將要用作應用程序主入口點的index.php文件放入package.json文件中。 只需將main屬性替換為您自己的URL。

package.json:

     {
    "name": "NodeTesting",
    "description": "Used for node testing and developing scripts",
    "version": "0.0.1",
    "main": "http://localhost/launchjs/index.php",
    "author": {
        "name": "bytewarestudios",
        "email": "admin@bytewarestudios.com"
    },
    "keywords": [],
    "licenses": {
        "type": "none"
    },
    "repository": {
        "type": "git",
        "url": "git://github.com//bytewarestudios"
    },
    "bugs": {
        "url": "http://github.com//NodeTesting/issues"
    }
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM