2020-04-18 11:17:49 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ngoduykhanh/wireguard-ui/handler"
|
|
|
|
"github.com/ngoduykhanh/wireguard-ui/router"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := router.New()
|
|
|
|
|
2020-04-19 10:50:59 +02:00
|
|
|
app.GET("/", handler.WireGuardClients())
|
2020-04-18 11:17:49 +02:00
|
|
|
app.POST("/new-client", handler.NewClient())
|
|
|
|
app.POST("/remove-client", handler.RemoveClient())
|
2020-04-19 10:50:59 +02:00
|
|
|
app.GET("/wg-server", handler.WireGuardServer())
|
|
|
|
app.POST("wg-server/interfaces", handler.WireGuardServerInterfaces())
|
2020-04-18 11:17:49 +02:00
|
|
|
app.Logger.Fatal(app.Start("127.0.0.1:5000"))
|
|
|
|
}
|