javascript - 如何在 Azure 上部署和运行 Passport Express 节点
问题描述
我正在使用护照 oauth2 策略为 SSO 创建快速节点服务。下面是我的 express 节点应用程序代码结构。
AUTH
- certs
server.cert
server.key
-index.html
-index.js (creates app as express() https server and validate app.get('/') path using passport)
-package.json (dependecies: body-parser, express, nodemon, passport, passport-oauth2, path)
下面是我的 Package.json
{
"name": "node-server",
"version": "1.0.0",
"description": "node server for passport authentication",
"main": "index.js",
"scripts": {
"server": "node index.js -p 3002"
},
"author": "abc",
"license": "ISC",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1",
"nodemon": "^2.0.6",
"passport": "^0.4.1",
"passport-oauth2": "^1.5.0",
"path": "^0.12.7"
}
}
现在,如果我运行命令“node index.js”或“npm run server”,它会以“https://localhost:8070”启动我的本地
同样,我想将它部署在 Azure 容器化服务器上并想启动服务器。
请帮助我了解如何在 azure 上部署它并启动类似于我的本地主机上方的服务器。
解决方案
要将 node.js 应用程序部署到 azure,您可以使用 Web 应用程序,点击此链接
部署完成后,Browse Website
在提示中选择以查看新部署的 Web 应用程序。
推荐阅读
- java - 扩展 log4j2.xml 并在它变得很长时将其拆分
- python - sleep() 在下面的代码中是如何工作的?
- r - 从所有具有事件边的顶点获取图 R igraph
- flutter - Flutter:组合 2 个类对象
- python - 使用 Fipy 的非线性 HJB PDE,PDE 转换
- kubernetes - 根据环境属性设置容器端口
- javascript - 尝试使用 connection.play 时弹出错误消息
- c - openssl EC_KEY_new_by_curve_name 在没有信息的情况下崩溃
- javascript - 如何以编程方式模拟输入内容可编辑的 HTML 元素?
- javascript - 根据 ui-grid 的每一行 id 将 JSON 数据导出到 AngularJs 中的 CSV 文件