Skip to content

Commit

Permalink
server: Prepare "GET /maintenance" endpoint
Browse files Browse the repository at this point in the history
This is useful for running occasional maintenance tasks.
  • Loading branch information
AlexITC committed Jan 4, 2019
1 parent 7599230 commit 54a61a1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions server/app/controllers/MaintenanceController.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package controllers

import controllers.common.{MyJsonController, MyJsonControllerComponents}
import javax.inject.Inject
import org.scalactic.Good
import play.api.libs.json.JsObject

import scala.concurrent.Future

class MaintenanceController @Inject() (
components: MyJsonControllerComponents)
extends MyJsonController(components) {

def run() = public { _ =>
Future.successful(Good(JsObject.empty))
}
}
1 change: 1 addition & 0 deletions server/conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# ~~~~

GET /health controllers.HealthController.check()
# GET /maintenance controllers.MaintenanceController.run()

GET /transactions/:txid controllers.TransactionsController.getTransaction(txid: String)
GET /transactions/:txid/raw controllers.TransactionsController.getRawTransaction(txid: String)
Expand Down

0 comments on commit 54a61a1

Please sign in to comment.