Second commit
added few test, first api to add book
This commit is contained in:
@@ -9,16 +9,15 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Port string `toml:"port" comment:"The port to listen on for the server."`
|
||||
DemoDataPath string `toml:"demo_data_path" comment:"The path to the sql file to load for demo data."`
|
||||
|
||||
Port string `toml:"port" comment:"The port to listen on for the server."`
|
||||
DatabaseFilePath string `toml:"database_file_path" comment:"Path to sqlite database file."`
|
||||
DemoDataPath string `toml:"demo_data_path" comment:"The path to the sql file to load for demo data."`
|
||||
}
|
||||
|
||||
func defaultConfig() Config {
|
||||
return Config{Port: "8080", DemoDataPath: ""}
|
||||
return Config{Port: "8080", DatabaseFilePath: "plm.db", DemoDataPath: ""}
|
||||
}
|
||||
|
||||
|
||||
func LoadConfig(configPath string) Config {
|
||||
f, err := os.ReadFile(configPath)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user