From b92b2f01110f4d4d5f64043c6b62be63f063a115 Mon Sep 17 00:00:00 2001 From: Mitchell Date: Wed, 25 May 2016 14:07:40 -0500 Subject: [PATCH] added redirect for vpn --- controller/redirect.go | 9 ++++++++- route/route.go | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/controller/redirect.go b/controller/redirect.go index 54ad480..bf2daaa 100644 --- a/controller/redirect.go +++ b/controller/redirect.go @@ -6,8 +6,15 @@ import ( ) // Redirect to discord -func Discord(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { +func DiscordRedirect(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { http.Redirect(w, r, "https://discordapp.com/invite/0Z2tzxKECEj2BHwj", 301) } + +// Redirect to discord +func VPNRedirect(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { + + http.Redirect(w, r, "https://mitchel.io:943", 301) + +} diff --git a/route/route.go b/route/route.go index 672399b..dc6105f 100644 --- a/route/route.go +++ b/route/route.go @@ -21,7 +21,8 @@ func Routes() *httprouter.Router { r.GET("/api/sensor/:location/:year", api.HandleSensorByLocationYear) r.GET("/api/sensor/:location/:year/:monthname", api.HandleSensorByLocationMonth) - r.GET("/discord", controller.Discord) + r.GET("/discord", controller.DiscordRedirect) + r.GET("/vpn", controller.VPNRedirect) //set up public folder path r.ServeFiles("/public/*filepath", http.Dir("./public"))