DB query refactoring

This commit is contained in:
Khanh Ngo 2020-04-23 18:01:40 +07:00
parent 7c3cac8084
commit 38c1f3a302
No known key found for this signature in database
GPG key ID: D5FAA6A16150E49E
3 changed files with 216 additions and 154 deletions

10
main.go
View file

@ -1,11 +1,21 @@
package main
import (
"fmt"
"github.com/ngoduykhanh/wireguard-ui/handler"
"github.com/ngoduykhanh/wireguard-ui/router"
"github.com/ngoduykhanh/wireguard-ui/util"
)
func main() {
// initialize DB
err := util.InitDB()
if err != nil {
fmt.Print("Cannot init database: ", err)
}
// register routes
app := router.New()
app.GET("/", handler.WireGuardClients())