我在看流星示例应用。我一直在玩游戏。我如何能够为页面添加自定义http标头(比如排行榜样本)?
编辑:我没有使用Apache或Nginx我使用meteor(meteor.com)它有自己的内置服务器
答案 0 :(得分:0)
我不知道你要做什么,但如果你想一直添加标题,试试......
NGINX:http://www.cyberciti.biz/faq/nginx-send-custom-http-headers/
APACHE:http://httpd.apache.org/docs/2.0/mod/mod_headers.html
答案 1 :(得分:0)
The HTTP method accepts a dictionary object for headers ex:
func render_html_page(w http.ResponseWriter, url string) {
t, err := template.ParseFiles(url)
if err != nil {
panic (err)
}
t.Execute(w, nil)
}
func index(c web.C, w http.ResponseWriter, r *http.Request) {
render_html_page(w, "./public/index.html")
}
func main() {
goji.Get("/", index)
goji.Serve()
}