How can I upload a static HTML site on Google App Engine?

后端 未结 3 890
执念已碎
执念已碎 2021-01-14 00:53

Is there any tutorial for this? I have 3 files in my project:

  • index.html
  • index.css
  • index.js

Should be simple, but so far I am

3条回答
  •  天命终不由人
    2021-01-14 01:22

    I don't really think that is what Google intends the service to be used for. But if you really need to serve some static content that is simple.

    You define an app.yaml file like so:

    application: staticapp
    version: 1
    runtime: python27
    api_version: 1
    threadsafe: true
    
    handlers:
    - url: /
      static_files: index.html
      upload: index.html
    
    - url: /index.css
      static_files: index.css
      upload: index.css
    
    -url: /index.js
      static_files: index.js
      upload: index.js
    

    Then use appcfg update . (assuming your using Linux in the source directory)

提交回复
热议问题