【问题标题】:How to deploy and run passport express node on azure如何在 Azure 上部署和运行 Passport Express 节点
【发布时间】:2021-03-21 21:56:30
【问题描述】:

我正在使用护照 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 上部署它并启动类似于上面我的本地主机的服务器。

【问题讨论】:

    标签: javascript node.js azure passport.js passport-local


    【解决方案1】:

    要将 node.js 应用程序部署到 azure,您可以使用 Web 应用程序,点击此链接

    https://docs.microsoft.com/en-us/azure/app-service/quickstart-nodejs?pivots=platform-linux#deploy-to-azure

    部署完成后,在提示中选择 Browse Website 以查看您新部署的 Web 应用程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-23
      • 1970-01-01
      • 2015-12-09
      • 2014-05-20
      相关资源
      最近更新 更多