diff --git a/Sources/App/Error.swift b/Sources/App/Error.swift index fabaf9e..79a89f2 100644 --- a/Sources/App/Error.swift +++ b/Sources/App/Error.swift @@ -17,9 +17,13 @@ enum CapError: Error { var response: HTTPResponseStatus { switch self { + /// 404 case .unknownId: return .notFound + /// 400 case .invalidBody: return .badRequest + /// 409 case .dataInconsistency: return .conflict + /// 412 case .invalidFile: return .preconditionFailed } } diff --git a/Sources/App/configure.swift b/Sources/App/configure.swift index 6db8263..99a443a 100755 --- a/Sources/App/configure.swift +++ b/Sources/App/configure.swift @@ -4,6 +4,9 @@ import Vapor public func configure(_ app: Application) throws { // uncomment to serve files from /Public folder // app.middleware.use(FileMiddleware(publicDirectory: app.directory.publicDirectory)) + + app.http.server.configuration.port = 6001 + // Register routes to the router try routes(app) // Configure the rest of your application here