             fatalError("Load config failed")
         }
 
-        guard let mysql = MySQLPerfect(host: dbconfig.host, user: dbconfig.user, passwd: dbconfig.password, dbname: dbconfig.dbname) else {
+        guard let mysql = MySQLPerfect(host: databaseConfig.host, user: databaseConfig.user, passwd: databaseConfig.password, dbname: databaseConfig.dbname) else {
             fatalError("Database init failed")
         }
-        let dbStorage = DatabaseStorage(database: mysql, prefix: dbconfig.tablePrefix)
+        let dbStorage = DatabaseStorage(database: mysql, prefix: databaseConfig.tablePrefix)
         let data = DataManager(dbStorage: dbStorage, memoryStorage: MemoryStorage())
         guard let utilities = UtilitiesPerfect() else {
             fatalError("Utilities init failed")



        let server = HTTPServer()
        server.serverAddress = "localhost"
        server.serverPort = 8080
        server.addRoutes(routes)
        server.documentRoot = "./webroot" // Setting the document root will add a default URL route which permits static files to be served from within.


import SwiftGD

class SiteMain {
    struct DatabaseConfig {
        var host: String
        var user: String
        var password: String
        var dbname: String
        var tablePrefix: String
    }

    struct ServerConfig {
        var address: String
        var port: UInt16
    }

    struct SiteConfig {
        var uploadSizeLimit: Int
    }

    typealias PageHandler = (SessionInfo?, HTTPRequest, HTTPResponse) -> SiteResponse
