Allow more customizability with config

This commit is contained in:
Jacob Gunther
2022-03-11 13:43:01 -06:00
parent 16d5c9689e
commit 061779f6f3
17 changed files with 206 additions and 103 deletions

View File

@@ -3,22 +3,24 @@ package main
import (
"fmt"
"log"
"main/src/redis"
"main/src/routes"
"os"
"strconv"
"time"
"github.com/buaazp/fasthttprouter"
"github.com/joho/godotenv"
"github.com/mineatar-io/api-server/src/conf"
"github.com/mineatar-io/api-server/src/redis"
"github.com/mineatar-io/api-server/src/routes"
"github.com/mineatar-io/api-server/src/util"
"github.com/valyala/fasthttp"
)
var (
host string = "127.0.0.1"
port uint16 = 3000
config *Configuration = &Configuration{}
r *redis.Redis = &redis.Redis{}
host string = "127.0.0.1"
port uint16 = 3000
config *conf.Configuration = &conf.Configuration{}
r *redis.Redis = &redis.Redis{}
)
func init() {
@@ -52,7 +54,8 @@ func init() {
port = uint16(parsedValue)
}
routes.InitRoutes(r)
routes.Init(r, config)
util.Init(r, config)
}
func main() {