diff --git a/backend-services/feed-service/app/controllers/MongoTestController.scala b/backend-services/feed-service/app/controllers/MongoTestController.scala deleted file mode 100644 index 8e827042c7ca40da1a79d9e00ec58433ea3e6e04..0000000000000000000000000000000000000000 --- a/backend-services/feed-service/app/controllers/MongoTestController.scala +++ /dev/null @@ -1,47 +0,0 @@ -package controllers - -import javax.inject._ -import play.api.mvc._ - -import models.MongoDBClient -import org.mongodb.scala.{Document} -import scala.concurrent.ExecutionContext.Implicits.global -import scala.concurrent.{Future, Await, TimeoutException} -import scala.concurrent.duration._ - -/** - * This controller creates an `Action` to handle HTTP MongoDB requests. - */ -@Singleton -class MongoTestController @Inject()(val controllerComponents: ControllerComponents) extends BaseController { - - /** - * Create an Action to test the Mongo Client. - */ - def index() = Action { - println("MongoController") - - val database_name = "{DATABASE_NAME}" - val collection_name = "{COLLECTION_NAME}" - - val mongo = new MongoDBClient() - - // Sequentially waits for Future objects to complete before calling next method - val result: Future[Seq[Document]] = for { - db <- mongo.getDatabase(database_name) - collection <- mongo.getCollection(db, collection_name) - findResult <- mongo.find(collection) - } yield findResult - - - try { - // Wait for 10 seconds for the Future to complete - val resultCompleted = Await.result(result, 4.seconds) - - val jsonResult: Seq[String] = resultCompleted.map(doc => doc.toJson()) - Ok(jsonResult.toString()) - } catch { - case _: TimeoutException => BadRequest("Request timed out") - } - } -} diff --git a/backend-services/feed-service/conf/routes b/backend-services/feed-service/conf/routes index c7bddeeab3e23b3746eb09190f234ea2b4565d0f..f580a63499ae37b02d98176ab0f2cb791c7ef26c 100644 --- a/backend-services/feed-service/conf/routes +++ b/backend-services/feed-service/conf/routes @@ -9,8 +9,6 @@ GET / controllers.HomeController.index() # Map static resources from the /public folder to the /assets URL path GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset) -GET /mongo_test controllers.MongoTestController.index() - GET /daily/getAll controllers.DailyController.getAll() GET /daily/users controllers.DailyController.getUserDailies()