Rename frontend as receiver
This commit is contained in:
parent
dc83efa868
commit
1ca5452707
111 changed files with 79 additions and 81 deletions
25
receiver/static.go
Normal file
25
receiver/static.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
var staticDir = "static"
|
||||
|
||||
func serveIndex(w http.ResponseWriter, r *http.Request) {
|
||||
http.ServeFile(w, r, path.Join(staticDir, "index.html"))
|
||||
}
|
||||
|
||||
type TeamMyServer struct {
|
||||
path2Dir string
|
||||
}
|
||||
|
||||
func (s TeamMyServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := os.Stat(startedFile); os.IsNotExist(err) {
|
||||
http.ServeFile(w, r, path.Join(s.path2Dir, "wait.json"))
|
||||
} else {
|
||||
http.ServeFile(w, r, path.Join(s.path2Dir, "my.json"))
|
||||
}
|
||||
}
|
||||
Reference in a new issue