This commit is contained in:
Christoph Hagen 2020-09-20 12:36:10 +02:00
parent 5672fbf300
commit 658f5b186d
2 changed files with 7 additions and 0 deletions

View File

@ -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
}
}

View File

@ -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