Skip to content

Commit

Permalink
Merge pull request #482 from guardian/jw-response-codes
Browse files Browse the repository at this point in the history
Add some new routes for response code testing
  • Loading branch information
jacobwinch authored Jun 13, 2024
2 parents 8dfb247 + 90f3031 commit 76d070a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/controllers/ManagementController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,17 @@ class ManagementController (override val controllerComponents: ControllerCompone
logger.info("hello from the health check")
Ok("OK")
}

def movedPermanently: Action[AnyContent] = Action {
MovedPermanently("https://www.theguardian.com/uk")
}

def badRequest: Action[AnyContent] = Action {
BadRequest
}

def error: Action[AnyContent] = Action {
InternalServerError
}

}
3 changes: 3 additions & 0 deletions conf/routes
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
GET / controllers.ManagementController.manifest
GET /healthcheck controllers.ManagementController.healthCheck
GET /moved-permanently controllers.ManagementController.movedPermanently
GET /bad-request controllers.ManagementController.badRequest
GET /error controllers.ManagementController.error
GET /robots.txt controllers.ManagementController.disallowRobots

# Map static resources from the /public folder to the /assets URL path
Expand Down

0 comments on commit 76d070a

Please sign in to comment.