Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Google App Engine

You're reading from   Mastering Google App Engine Build robust and highly scalable web applications with Google App Engine

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781784396671
Length 368 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Serving static resources

We are making progress. From strings to templates, but still no cosmetics. Just plain HTML is what we are serving. However, to add some beautification to the pages, we will have to style it. To style the pages better, we will need style sheets, and style sheets might need images to beautify our pages This means that we have to serve static files as well.

Serving static files is pretty simple. You just need to add a handler in your app.yaml file as usual, but instead of the script node, you need to add a static_dir node, which indicates the directory in which the files that you want to serve are present. Let's modify our earlier app to serve some static files such as style sheets and images:

- handlers:
  - url:/assets/.*
    static_dir: assets

You may have already guessed that any URL that starts with /assets will be handled by this handler. However, instead of invoking a script, it maps itself to a directory called assets, which is located at the root of your...

You have been reading a chapter from
Mastering Google App Engine
Published in: Oct 2015
Publisher:
ISBN-13: 9781784396671
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime