Question

Is it possible to host a static html website on AppEngine? And how to make my domain name work with it?

Was it helpful?

Solution

I wrote a library to do just that, and it works on AppEngine or any other server you want:

https://github.com/stochastic-technologies/static-appengine-hoster

You just throw your files in the directory, and it hosts them. It also supports Jinja2 templates, URL rewriting and multiple domains.

OTHER TIPS

Yes you can host your static files on AppEngine. Just configure your app.yaml-file like the following

- url: /
  static_dir: static_files

And put your files in the directory static_files. This way every request is routed to your static files.

I just had the same problem and decided to use this solution... It serves static files from the root directory and uses index.html if you don't give an file. Hope that helps.

# re-direct to index.html if no path is give
- url: /
  static_files: index.html
  upload: index.html

# access the static resources in the root director

- url: /(.*)
  static_files: \1
  upload: (.*)

I've found what I believe is a really neat solution.

DryDrop

Basically, from what I'm led to believe, you deploy DryDrop to GAE, configure (domains, Github html repository etc.), then publish your static HTML by pushing to the GitHub repository (GitHub utilises 'hooks' to alert your DryDrop install to any new HTML changes).

I haven't used it personally, yet, but if the former CTO of Threadless Tees, Harper Reed, thinks it's OK, that's good enough for me :-D .

Cheers

Rich

This also worked for me. It's exactly like @BradAbrams solution only with static_dir for the second part :

handlers:

- url: /
  static_files: index.html
  upload : index.html

- url: /*
  static_dir: "."

You don't need to make use of any other scripts per say to host a static website. I just had to do similar things that you have mentioned.

  1. A custom domain addition
  2. Hosting Mostly HTML and Static content
  3. A few php scripts (Not required for you)

Define Handlers for every static .html file like this

handlers:
    - url: /
      static_files: index.html
      upload : index.html

    - url: /index.html
      static_files: index.html
      upload : index.html

For Static Directories use this

- url: /images
  static_dir: images

Making Use of Custom Domain

If you have purchased domain from somewhere else then you'll have to add your domain as custom domain and then go on with verification process for your domain. In my case my domain provider was godaddy.com and google did the verification process automatically. Although I had to add the Cname records after that manually in godaddy domain's DNS section. Google has complete automated system in place for the same so that wont be difficult at all.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top