OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "flag" | 8 "flag" |
9 "fmt" | 9 "fmt" |
10 "io/ioutil" | 10 "io/ioutil" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 fmt.Fprintf(os.Stderr, " /echo_post -> custom echo handler\n") | 72 fmt.Fprintf(os.Stderr, " /echo_post -> custom echo handler\n") |
73 http.HandleFunc("/echo_post", func(w http.ResponseWriter, r *http.Request) { | 73 http.HandleFunc("/echo_post", func(w http.ResponseWriter, r *http.Request) { |
74 defer r.Body.Close() | 74 defer r.Body.Close() |
75 body, _ := ioutil.ReadAll(r.Body) | 75 body, _ := ioutil.ReadAll(r.Body) |
76 w.Write(body) | 76 w.Write(body) |
77 }) | 77 }) |
78 | 78 |
79 addMapping("/gen/", genRoot) | 79 addMapping("/gen/", genRoot) |
80 | 80 |
81 // FIXME: Unclear if these are correct now that we have /gen. | |
82 // /gen is more explicit, but also is less like how a 3rd party might | |
83 // deploy a sky app. | |
84 addMapping("/mojo/public/", path.Join(genRoot, "mojo", "public")) | |
85 addMapping("/mojo/services/", path.Join(genRoot, "mojo", "services")) | |
86 addMapping("/sky/services/", path.Join(genRoot, "sky", "services")) | |
87 | |
88 http.ListenAndServe(":" + port, nil) | 81 http.ListenAndServe(":" + port, nil) |
89 } | 82 } |
OLD | NEW |