mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-08-22 00:24:38 -05:00
Update config to have port
This commit is contained in:
@@ -2,7 +2,7 @@ package common
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -11,10 +11,11 @@ type Config struct {
|
||||
DatabaseAddress string `xml:"databaseAddress"`
|
||||
DatabaseName string `xml:"databaseName"`
|
||||
Address string `xml:"address"`
|
||||
Port string `xml:"nasPort"`
|
||||
}
|
||||
|
||||
func GetConfig() Config {
|
||||
data, err := ioutil.ReadFile("config.xml")
|
||||
data, err := os.ReadFile("config.xml")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<Config>
|
||||
<!-- The address the server will bind to -->
|
||||
<address>127.0.0.1</address>
|
||||
<nasPort>80</nasPort>
|
||||
|
||||
<!-- Database Credentials -->
|
||||
<username>username</username>
|
||||
|
||||
@@ -32,7 +32,7 @@ func StartServer() {
|
||||
}
|
||||
|
||||
// Finally, initialize the HTTP server
|
||||
address := config.Address
|
||||
address := config.Address + ":" + config.Port
|
||||
r := NewRoute()
|
||||
ac := r.HandleGroup("ac")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user