Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRELLO-2649 : add healthcheck #2

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/controllers/HealthController.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package controllers

import play.api.libs.json.Json
import play.api.mvc.AbstractController
import play.api.mvc.ControllerComponents

import scala.concurrent.ExecutionContext
import scala.concurrent.Future

class HealthController(
controllerComponents: ControllerComponents
)(implicit val ec: ExecutionContext)
extends AbstractController(controllerComponents) {

def health =
Action.async(parse.empty) { _ =>
Future.successful(Ok(Json.obj("name" -> "signalconso-antivirus")))
}

}
1 change: 1 addition & 0 deletions app/loader/SignalConsoApplicationLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class SignalConsoComponents(
lazy val router: Router =
new _root_.router.Routes(
httpErrorHandler,
new HealthController(controllerComponents),
antivirusController
)

Expand Down
1 change: 1 addition & 0 deletions conf/routes
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

GET / controllers.HealthController.health
POST /api/file/scanFile controllers.AntivirusController.scanAndUpload()
POST /api/file/scan controllers.AntivirusController.scan()
POST /api/file/rescan controllers.AntivirusController.rescan()
Expand Down
Loading