mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
added redirect for vpn
This commit is contained in:
@@ -6,8 +6,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Redirect to discord
|
// 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)
|
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)
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ func Routes() *httprouter.Router {
|
|||||||
r.GET("/api/sensor/:location/:year", api.HandleSensorByLocationYear)
|
r.GET("/api/sensor/:location/:year", api.HandleSensorByLocationYear)
|
||||||
r.GET("/api/sensor/:location/:year/:monthname", api.HandleSensorByLocationMonth)
|
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
|
//set up public folder path
|
||||||
r.ServeFiles("/public/*filepath", http.Dir("./public"))
|
r.ServeFiles("/public/*filepath", http.Dir("./public"))
|
||||||
|
|||||||
Reference in New Issue
Block a user