 
                             let localname = "\(UUID().string).\(fileExtension)"
                             return controller.postAddPage(session: session, comicId: cid, title: title, description: description, imgWebURL: "/images/"+localname, onSeccuss: { (pageId: UInt32) in
-
+                                
                                 try controller.toolAddFile(pageId: pageId, filename: upload.fileName, localname: localname, mimetype: upload.contentType, size: UInt32(upload.fileSize))
                                 guard image.write(to: URL(fileURLWithPath: "webroot/images/"+localname), quality: 75) else {
                                     throw WebFrameworkError.RuntimeError("Failed write image file")

            }
            return SiteResponse(status: .NotFound, session: session)
        })


        let server = HTTPServer()
        server.serverAddress = serverConfig.address
        server.serverPort = serverConfig.port
        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.

        do {
            try server.start()
        } catch {
            fatalError("\(error)")
        }
    }
}


    }

    func start() {

        setupForumRoutes()
        setupComicRoutes()

        let server = HTTPServer()
        server.serverAddress = serverConfig.address
        server.serverPort = serverConfig.port
        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.

        do {
            try server.start()
        } catch {
            fatalError("\(error)")
        }
    }
}

extension SiteMain {
    func setupForumRoutes() {
        addRoute(method: .get, uri: "/", handler: { (controller: SiteController, session: SessionInfo, request: HTTPRequest, response: HTTPResponse) in
            return controller.mainPage(session: session as! ForumSessionInfo, page: 1)
        })
