2
我希望使用Google App Engine在一个应用程序中提供静态文件和REST请求。在app.yaml中混合脚本和静态
我用这个的app.yaml
application: test
version: 1
runtime: go
api_version: go1
default_expiration: "7d 5h"
handlers:
- url: /(index.html)?
static_files: static/app/index.html
upload: static/app/index.html
http_headers:
Content-Type: text/html; charset=UTF-8
- url:/
static_dir: static/app/
http_headers:
Vary: Accept-Encoding
- url: /.*
script: _go_app
它适用于静态文件,但我不能访问我的脚本。
package main
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/hello_world", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, world!")
}
有可能吗?如果是,我该如何继续?