Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google app engine 我应该如何编写我的Google App Engine App.yaml文件?_Google App Engine_Yaml - Fatal编程技术网

Google app engine 我应该如何编写我的Google App Engine App.yaml文件?

Google app engine 我应该如何编写我的Google App Engine App.yaml文件?,google-app-engine,yaml,Google App Engine,Yaml,我注册了一个谷歌应用程序引擎应用程序,我有以下一些文件: /index.html /css/index.css /js/index.js /反馈/index.html /反馈/css/index.css /反馈/js/index.js 我应该如何编写app.yaml文件 谢谢大家! 将前3个文件放入文件夹名“静态”” application: appname version: 1 runtime: python api_version: 1 handlers: - url: /favic

我注册了一个谷歌应用程序引擎应用程序,我有以下一些文件:

/index.html

/css/index.css

/js/index.js

/反馈/index.html

/反馈/css/index.css

/反馈/js/index.js

我应该如何编写app.yaml文件


谢谢大家!

将前3个文件放入文件夹名“静态”

application: appname
version: 1
runtime: python
api_version: 1

handlers:

-   url: /favicon.ico
    static_files: img/favicon.ico
    upload: img/favicon.ico
    mime_type: image/x-icon

-   url: /css  #your css folder
    static_dir: css 

-   url: /scripts #your javascript folder
    static_dir: scripts


-   url: /img #your image folder
    static_dir: img

-   url: /.*
    script: your_script.py
在你的main.py中

class IndexHandler(webapp.RequestHandler):
    def get(self):
        self.redirect('static/index.html')


def main():
    application = webapp.WSGIApplication([
            ('/index.html', IndexHandler),
        ], debug=True)
    run_wsgi_app(application)
这样写不好,,
但这会解决您的问题。

谢谢您的回复!大熊。
class IndexHandler(webapp.RequestHandler):
    def get(self):
        self.redirect('static/index.html')


def main():
    application = webapp.WSGIApplication([
            ('/index.html', IndexHandler),
        ], debug=True)
    run_wsgi_app(application)