Google app engine 谷歌应用引擎100 URLMap条目限制
我一直在使用google app engine构建我的网站,但遇到了一个关于URLMap最大数量的问题(我有101个URL,但限制为100个)。以下是错误消息:Google app engine 谷歌应用引擎100 URLMap条目限制,google-app-engine,yaml,Google App Engine,Yaml,我一直在使用google app engine构建我的网站,但遇到了一个关于URLMap最大数量的问题(我有101个URL,但限制为100个)。以下是错误消息: Fatal error when loading application configuration: Invalid object: Found more than 100 URLMap entries in application configuration in "\AppPest\app.yaml", l
Fatal error when loading application configuration:
Invalid object:
Found more than 100 URLMap entries in application configuration
in "\AppPest\app.yaml", line 269, column 28
我试图更改appinfo.py文件中的设置MAX\u URL\u MAPS=1000
,但没有成功。谁能给我一些建议吗
编辑:
另一个问题是,我的一些URL类似,比如a_input.html、b_input.html、c_input.html。有没有办法简化它以减少URL的数量?下面是我的yaml文件的一个示例
#a
- url: /a_input.html
script: a/a_input.py
#b
- url: /b_input.html
script: b/b_input.py
#c
- url: /c_input.html
script: c/c_input.py
解决方案将取决于您使用的语言。如果您使用的是python 2.7,您可以做的是: 1) 使用正则表达式定义URL,有关详细信息,请参阅
handlers:
- url: /(.*?)_input.html
script: /input/\1.app
2) 将一组URL指向同一个应用程序,并让该应用程序处理不同的请求
handlers:
- url: /(.*?)_input.html
script: /input/input.app
app = webapp2.WSGIApplication([('/a_input.html', AInputPage), ('/b_input.html', BInputPage)])
根据您提供的信息,我无法判断a_input.html、b_html是否是静态的。但如果它们是静态的,您也可以这样做:
3) 使用引用它们,它也接受正则表达式
- url: /input
static_dir: static/input
请参阅以了解更多详细信息,特别是与java相关的信息。我在使用java SDK时也遇到了同样的问题。 我从欢迎文件列表中删除index.html。 现在,我的入口点是index.jsp,它重定向到我的index.html页面 在web.xml中:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
index.jsp
在appengine-web.xml中:
<static-files>
<include path="/fonts/**" />
<include path="/app/fonts/**" />
<include path="/**.html" />
<include path="/**.js" />
<include path="/**.css" />
<include path="/**.ico" />
<include path="/**.png" />
<include path="/**.jpg" />
<include path="/**.jpeg" />
<include path="/**.gif" />
</static-files>
感谢您的帮助。我喜欢对URL进行分组的方式,但我的情况是否可能(请参阅我的编辑)?是的,您需要使用方法1),请参考我指出的文档。下面是代码(抱歉,注释中没有格式):-url:/(.*?)\u input.html脚本:\1/\1\u input.py。下次,请指定您正在使用的运行时。