Hi,
After struggling A LOT, I finally was able to figure out the solution for my topic here: Have node.js installed but cant get socket.io to work it turns out that when registering the application you MUST leave the Base Application URL field empty, no matter what folder you plan to access your app from.
Lets say my domain is example.com and I want to install my chat on a folder called myapp so you can access it from here:
example.com/myapp
as registering the app, you come across a filed that says:
Base Application URL: Enter the application’s base URL. After you register the application, you can use this URL to access it.
common sense tells you to enter "myapp", right? Well, IGNORE that because if you enter anything else than a single / your socket.io app wont work. In order to be able to access it from the folder you want you must declare it within the app.js file like this:
then your app will work. However, notice than your ENTIRE DOMAIN will be now under the node.js, server, not only the folder where you access the app from which I dont think is right.
I dont know whether is a cpanel bug or a socket.io bug but I think its something it must be fixed because it will save the users HOURS of frustration.
Thank you.
After struggling A LOT, I finally was able to figure out the solution for my topic here: Have node.js installed but cant get socket.io to work it turns out that when registering the application you MUST leave the Base Application URL field empty, no matter what folder you plan to access your app from.
Lets say my domain is example.com and I want to install my chat on a folder called myapp so you can access it from here:
example.com/myapp
as registering the app, you come across a filed that says:
Base Application URL: Enter the application’s base URL. After you register the application, you can use this URL to access it.
common sense tells you to enter "myapp", right? Well, IGNORE that because if you enter anything else than a single / your socket.io app wont work. In order to be able to access it from the folder you want you must declare it within the app.js file like this:
JavaScript:
app.get('/myapp', (req, res) => {
I dont know whether is a cpanel bug or a socket.io bug but I think its something it must be fixed because it will save the users HOURS of frustration.
Thank you.
Last edited: