Example #1
0
func PostLogin(res http.ResponseWriter, req *http.Request) {
	if !info.CheckAddr(req.RemoteAddr) {
		return
	}
	data, err := ioutil.ReadAll(req.Body)
	check(err)
	js := bytes.NewReader(jSONify(string(data)))
	sres, err := http.Post("http://diamondnotcrush.herokuapp.com/user/login", "application/json", js)
	check(err)
	if err != nil {
		log.Println("Login failed")
	} else {
		log.Println("Login success")
	}
	Ping(res, req, sres)
}
Example #2
0
func GetLogin(res http.ResponseWriter, req *http.Request) {
	if !info.CheckAddr(req.RemoteAddr) {
		return
	}
	portal.Login(res, req)
}
Example #3
0
func MainPage(res http.ResponseWriter, req *http.Request) {
	if !info.CheckAddr(req.RemoteAddr) {
		return
	}
	portal.MainPage(res, req, info.Dir(), info.Port(), verify, userid)
}