通过nodejs socket.io提供PHP服务

I'm running both nodejs and php in my app but can only use one port. So what I'd like to do is to make nodejs the user on the port and then give index.php to the user by routing, something like:

app.get("index.php") 

Does anyone have any idea on how I could do this? Thank you very much...

You could try placing the index.php file you want to use as the main entry point of your application by putting it in the package.json file. Just replace the main property with your own 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"
    }
}