How to host static HTML files on Google App Engine?

前端 未结 7 2377
予麋鹿
予麋鹿 2020-12-22 21:57

Is it possible to host a static HTML website on App Engine? And how to make my domain name work with it?

7条回答
  •  余生分开走
    2020-12-22 22:29

    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.

提交回复
热议问题