Skip to content

Commit

Permalink
Add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
kilnerm committed Jan 21, 2019
1 parent 793eda9 commit edb4d9a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Sources/Kitura/staticFileServer/StaticFileServer.swift
Expand Up @@ -103,7 +103,9 @@ open class StaticFileServer: RouterMiddleware {
/// the headers of the response.
public init?(path: String = "./public", options: Options = Options(),
customResponseHeadersSetter: ResponseHeadersSetter? = nil) {
print("In SFS init with path: \(path)")
absoluteRootPath = StaticFileServer.ResourcePathHandler.getAbsolutePath(for: path)
print("SFS init - absolute path: \(absoluteRootPath)")
// Check the supplied path is a directory and if not fail initialisation
var isDirectory = ObjCBool(false)

Expand All @@ -113,7 +115,9 @@ open class StaticFileServer: RouterMiddleware {
#else
let isDirectoryBool = isDirectory
#endif
print("SFS init - path exists: \(pathExists), is directory: \(isDirectoryBool)")
guard pathExists, isDirectoryBool else {
print("SFS init - returning nil")
return nil
}

Expand Down

0 comments on commit edb4d9a

Please sign in to comment.