简体   繁体   English

通过GitHub部署时,Express 4应用程序在Azure中不起作用

[英]Express 4 app doesn't work in Azure when deployed via GitHub

I'm working on an Express app that I initially created from the Basic Azure Node.js Express 4 Application template in Visual Studio. 我正在开发一个Express应用程序,我最初是从Visual Studio中的Basic Azure Node.js Express 4应用程序模板创建的。 In other words, it has the web.config modifications necessary to support Express 4's www\\bin structure . 换句话说, 它具有支持Express 4的www\\bin结构所必需的web.config修改

This app works fine when debugging via Visual Studio or running directly via Node command line. 通过Visual Studio调试或直接通过Node命令行运行时,此应用程序正常工作。 However, deployments from source control do not work when I hooked it up to the GitHub repo. 但是,当我将它连接到GitHub存储库时,源代码管理中的部署不起作用。 I can see the project root in the site\\wwwroot folder. 我可以在site\\wwwroot文件夹中看到项目根目录。 Even more strange, publishing directly from Visual Studio works. 更奇怪的是,直接从Visual Studio发布工作。

This turned out to be a simple oversight, but I feel that it can easily trip up others so I'll share the answer here. 事实证明这是一个简单的疏忽,但我觉得它很容易绊倒别人,所以我会在这里分享答案。 I'm using the Visual Studio .gitignore file from GitHub and it includes a rule to ignore [Bb]in/ as these are usually build output. 我正在使用GitHub中的Visual Studio .gitignore文件,它包含一个规则来忽略[Bb]in/因为它们通常是构建输出。 My commits were not including the contents of /bin , so my continuous deployment obviously wasn't picking these up either. 我的提交不包括/bin的内容,所以我的持续部署显然也没有选择它们。 Simply commenting out this line fixed this issue. 简单地评论这一行修复了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过Visual Studio部署时Express 4应用程序无法在Azure中运行 - Express 4 app doesn't work in Azure when deployed via Visual Studio Express.js应用程序在本地可以正常运行,但是在Heroku上部署时无法正常工作 - Express.js app works fine locally but doesn't work when deployed on Heroku 在 Azure 上成功部署 Express 应用程序,但仍然没有任何效果 - Express app deployed successfully on Azure but still nothing work 如何通过appveyor(从github中拉出)将node.js应用程序部署到azure? - How can a node.js app be deployed to azure via appveyor (pulled from github)? 当我尝试通过 GCP deploy 命令托管 Node.js 应用程序时,它不起作用。 错误:找不到模块“express” - Node.js app doesn't work when I try to host it via GCP deploy command. Error: Cannot find module 'express' 为什么访问本地服务的Express应用程序时nodejs http请求不起作用? - Why nodejs http request doesn't work when accessing a local served express app? 部署应用程序后,流星数据库find()不返回文档 - Meteor database find() doesn't return documents when app deployed 在 heroku 上部署 express 应用程序时无法获取/ - Cannot Get/ when express app is deployed on heroku 根“/”上的快速路由在 app.get 中不起作用 - Express routing on root "/" doesn't work in app.get password.js:请记住我在Express应用程序中不起作用 - passport.js: remember me doesn't work in express app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM