3
目前我在Nodejs中创建了一个简单的文件,它在我的localhost:8080上运行良好。但我想在我的个人域名上运行这个文件。那么什么帮助设置需要做的,我个人域前运行:xyz.com在我的域上运行nodejs文件
这是我这是运行在本地主机上精细的NodeJS简单的代码
<pre>
var http = require('http');
var server = http.createServer(function (request, response) {
if (request.url === '/') {
response.setHeader('Content-Type', 'text/html');
response.end('<strong>obligatory bear!</strong>');
}
});
server.listen(8080, function() {
console.log('Im listening on port 8080');
});
</pre>
1.使用凭据在您的托管服务器上安装node.js。 2.通过访问终端在主机服务器上运行它。与您在本地系统上运行它的方式相同。 –
感谢您的回复Luke –