| 123456789101112131415161718192021222324 |
- package main
- import (
- "battlecamp-go-server/board"
- "log"
- "net/http"
- "strconv"
- )
- func main() {
- http.HandleFunc("/", generateBoard)
- log.Fatal(http.ListenAndServe(":8081", nil))
- }
- func generateBoard(w http.ResponseWriter, r *http.Request) {
- x, _ := strconv.Atoi(r.FormValue("x"))
- y, _ := strconv.Atoi(r.FormValue("y"))
- width, _ := strconv.Atoi(r.FormValue("width"))
- height, _ := strconv.Atoi(r.FormValue("height"))
- totalWidth, _ := strconv.Atoi(r.FormValue("totalWidth"))
- totalHeight, _ := strconv.Atoi(r.FormValue("totalHeight"))
- b := board.NewPartial(x, y, width, height, totalWidth, totalHeight)
- b.WriteData(w)
- }
|