缺lessserver.js / app.js文件,web.config不会生成

我正在使用Windows Azure Mobile Services的源代码pipe理function来推送自定义API脚本。

我做了什么:

  1. 克隆git仓库。 (它包含了一堆用readme.md文件解释什么地方的目录,以及一些现有表的权限的configuration文件。)
  2. 添加了service/api/test.jsservice/api/test.json文件(自定义API脚本和configuration)。
  3. 承诺并将更改推送到远程。

我从git获得了以下输出:

 remote: Updating branch 'master'. remote: Updating submodules. remote: Preparing deployment for commit id '1cbfbd5ac1'. remote: Running custom deployment command... remote: Running deployment command... remote: Handling Basic Web Site deployment. remote: KuduSync.NET from: 'D:\home\site\repository\service' to: 'D:\home\site\wwwroot\App_Data\config\scripts' remote: Copying file: 'api\test.js' remote: Copying file: 'api\test.json' remote: Missing server.js/app.js files, web.config is not generated remote: Node.js versions available on the platform are: 0.6.17, 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.10.5, 0.10.18, 0.10.21, 0.10.24. remote: Selected node.js version 0.10.24. Use package.json file to choose a different version. remote: npm WARN package.json myservice@1.0.0 No repository field. remote: npm WARN package.json myservice@1.0.0 No README data remote: Finished successfully. remote: Deployment successful. 

现在,当我试图通过标准的API访问任何现有的表(例如张贴到https://myservice.azure-mobile.net/tables/MyTable ),我得到一个500内部服务器错误。

我想在上面的输出中的这一行与它有关:

remote: Missing server.js/app.js files, web.config is not generated

但是,从来没有任何server.jsapp.js包含在git仓库中,我不知道这些文件应该包含什么,因为在文档中似乎没有提到这些文件。

事实certificate,这个错误信息不是罪魁祸首:

 remote: Missing server.js/app.js files, web.config is not generated 

就像一个好的程序员一样,我把configuration信息放在<PROJECT_ROOT>/shared/config.json 。 当我检查日志时,它抱怨没有正确configuration路由。 该文档意味着只有<PROJECT_ROOT>/api包含自定义路由,所以我不知道为什么它将共享目录中的JSON文件解释为路由configuration,当文档明确指出共享目录是专用于表使用的共享代码和自定义API脚本。

将其从config.json更改为config.js并进行必要的代码更改后,它们都重新开始工作。

我仍然收到有关缺lessserver.js / app.js文件的警告,但似乎不影响任何内容。

结论:不要将JSON文件添加到最初与脚本捆绑在一起的readme.md文件中指定的以外的Azure移动服务脚本。