How to write app.yaml file for Google App Engine?

I have registered the Google App Engine application and I have a few files below:

/index.html

/css/index.css

/js/index.js

/feedbacks/index.html

/feedbacks/css/index.css

/feedbacks/js/index.js

How to write an app.yaml file?

Thanks!

+4
source share
2 answers
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 
+4
source

Put your first 3 files in the folder name " static "

 handlers: - url: /feedbacks/ static_dir: feedbacks - url: /css/ static_dir: static - url: /js/ static_dir: static - url: /.* script: main.py 

In 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) 

It is not good to write this way, but it will solve your problem.

0
source

All Articles