Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google app engine static file handlers example

The static_dir examples are pretty clear

So for example, I want requests to http://mysite.appengine.com/main.htm to go to the C:\<appenginesiteroot>\html\main.htm file (on the hard disk), and this can be achieved with

# app.yaml
- url: /
  static_dir: html

But when it comes to using static file handlers its not clear.

Specifically I want to map a URL to an html or other static file.

So for example, requests for http://mysite.appengine.com/ will send down main.htm.

- url: /
  script: main.htm ?? #fails because main.htm isn't a script file

I know it is possible using a directive like:

- url: /
  script: main.py

Then having main.py simply send down html, but I'd like to know if "static file handlers" are really in GAE or if its just a hoax.

like image 812
bobobobo Avatar asked Mar 23 '11 16:03

bobobobo


1 Answers

script is for scripts, you are trying to map to a static file. Have you looked at the Static File Pattern Handlers section of the doc?

Have you tried:

- url: /
  static_files: main.html
  upload: main.html
like image 188
Robert Kluin Avatar answered Sep 29 '22 11:09

Robert Kluin