简体   繁体   中英

What's the equivalence of “Node app.js” on a file domain?

On localhost all there is to do is type "Node app.js" to run node locally, but I am trying to do this on a domain that I do not own but has Node installed. " https://www .'example'.com/MyID/myapp" is the example I will be using, do note that I only have access to edit everything in "MyID" file and not " https://www .'example'.com". the problem is that I do not know how to run node on the domain. The IDE I'm using is codetasty and it does not say how to run node on their sandboxes either.

This is a tough question because there are a lot of misunderstandings here. Node is a process that runs a JavaScript file. You can access http://localhost like a website because your node app creates a server that listens to a port and responds to the HTTP requests made by your browser. It seems like you are asking how to run node on a file hosted online. That may be possible but I think you actually want to run the node server on your web host and then connect to that instance with your browser. Most webhosts don't allow you to run node so you may need something like digital ocean to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM