有可能只在Azure或OpenShift上托管Node JS代码吗? [英] Is that possible to host only node js code on azure or openshift?
问题描述
我的意思是,如果不托管索引页"或视图",则可以仅以天蓝色或openshift托管节点js代码和数据库.我是服务器端开发人员,因此需要托管它.预先感谢
是的,您的问题的答案是肯定的.您可以从Azure提供的空的nodejs应用程序模板开始.
请登录
创建任务后,可以启用Visual Studio在线扩展,并且可以查看和修改应用程序中的脚本和模块.您可以参考
毕竟,您会发现您的入门应用程序仅包含一个nodejs脚本,即 server.js
,其中包含:
var http = require('http');http.createServer(function(req,res){res.writeHead(200,{'Content-Type':'text/html'});res.end('Hello,world!');}).listen(process.env.PORT || 8080);
I mean without hosting "index page" or "view", is that possible to host only node js code and database in azure or openshift. I'm server side developer, so I need to host it. Thanks in advance
Yes, the answer to your question is positive. You can start up with an empty nodejs application template provided by Azure.
Please login Azure portal=>click New button=>select "Web+Mobile"=>clcik See all=>type "Node JS Empty Web App" in the search bar=>select the template to create a new Azure Web App with a default nodejs application without any views.
After creating task, you can enable the Visual Studio online extension, and you can see and modify the scripts and modules in your application. You can refer to the answer of How to install composer on app service? for enabling the extension.
And login Azure portal, find your application in App Services, click Tools button on the header nav, click Visual Studio Online then click go, to login VSO editor.
After all, you can find your getting started application only contains one nodejs script, server.js
with:
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/html' });
res.end('Hello, world!');
}).listen(process.env.PORT || 8080);
这篇关于有可能只在Azure或OpenShift上托管Node JS代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!