17 lines
376 B
Crystal
17 lines
376 B
Crystal
require "yaml"
|
|
|
|
class Config
|
|
include YAML::Serializable
|
|
|
|
property port : Int32 = 8090
|
|
property db : String = "./db.sqlite3"
|
|
property dbTableName : String = "files"
|
|
property redisUrl : String = "127.0.0.1:6379"
|
|
|
|
def self.load
|
|
config_file = "./config.yml"
|
|
config_yaml = File.read(config_file)
|
|
config = Config.from_yaml(config_yaml)
|
|
config
|
|
end
|
|
end
|