~reesmichael1/chantpointer

ref: 0ba42d0dff660f88ca66c3b97a6fed56d37721a4 chantpointer/main.go -rw-r--r-- 496 bytes
0ba42d0dMichael Rees Use .ssh/config as secret 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
)

func main() {
	var port int
	flag.IntVar(&port, "port", 7777, "the port that the server will run on")
	flag.Parse()

	static := http.FileServer(http.Dir("static"))
	http.Handle("/static/", http.StripPrefix("/static", static))
	http.HandleFunc("/chant/", ChantHandler)
	http.Handle("/generate", ErrorHandler(GenerateHandler))
	http.Handle("/", ErrorHandler(IndexHandler))
	log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", port), nil))
}