func Setup(s *cgi.LoggingServeMux) {
	rtr := mux.NewRouter()
	cgi.RegistToRouter(rtr, cfg.ThreadURL+"/", printThreadIndex)
	reg := cfg.ThreadURL + "/{datfile:thread_[0-9A-F]+}/{id:[0-9a-f]{32}}/s{stamp:\\d+}.{thumbnailSize:\\d+x\\d+}.{suffix:.*}"
	cgi.RegistToRouter(rtr, reg, printAttach)
	reg = cfg.ThreadURL + "/{datfile:thread_[0-9A-F]+}/{id:[0-9a-f]{32}}/{stamp:\\d+}.{suffix:.*}"
	cgi.RegistToRouter(rtr, reg, printAttach)
	reg = cfg.ThreadURL + "/{path:[^/]+}{end:/?$}"
	cgi.RegistToRouter(rtr, reg, printThread)
	reg = cfg.ThreadURL + "/{path:[^/]+}/{id:[0-9a-f]{8}}{end:$}"
	cgi.RegistToRouter(rtr, reg, printThread)
	reg = cfg.ThreadURL + "/{path:[^/]+}/p{page:[0-9]+}{end:$}"
	cgi.RegistToRouter(rtr, reg, printThread)
	s.Handle(cfg.ThreadURL+"/", handlers.CompressHandler(rtr))
}
Setup setups handlers for thread.cgi
package thread
import (
	"encoding/base64"
	"errors"
	"fmt"
	"html"
	"html/template"
	"log"
	"math"
	"math/rand"
	"mime"
	"mime/multipart"
	"net/http"
	"net/url"
	"path"
	"regexp"
	"strconv"
	"strings"
	"time"
	"github.com/gorilla/handlers"
	"github.com/gorilla/mux"
	"github.com/shingetsu-gou/shingetsu-gou/cfg"
	"github.com/shingetsu-gou/shingetsu-gou/cgi"
	"github.com/shingetsu-gou/shingetsu-gou/record"
	"github.com/shingetsu-gou/shingetsu-gou/tag/user"
	"github.com/shingetsu-gou/shingetsu-gou/thread"
	"github.com/shingetsu-gou/shingetsu-gou/thread/download"
	"github.com/shingetsu-gou/shingetsu-gou/updateque"
	"github.com/shingetsu-gou/shingetsu-gou/util"
)