Skip to content
Snippets Groups Projects
Commit fcf02ad8 authored by Felipe D'Abrantes's avatar Felipe D'Abrantes
Browse files

Add custom start up

parent 00bbc0d8
No related branches found
No related tags found
1 merge request!31Implement Mongo Seeder v2
This commit is part of merge request !31. Comments created here will be created in the context of that merge request.
import scala.concurrent.Future
import javax.inject._
import play.api.inject.ApplicationLifecycle
// Creates an `ApplicationStart` object once at start-up and registers hook for shut-down.
@Singleton
class ApplicationStart @Inject() (lifecycle: ApplicationLifecycle) {
println("Starting...")
// Shut-down hook
lifecycle.addStopHook { () =>
Future.successful(())
}
}
import com.google.inject.AbstractModule
class Module extends AbstractModule {
override def configure() = {
bind(classOf[ApplicationStart]).asEagerSingleton()
}
}
# MongoDB Connection Strings
mongodb.uri= "mongodb://localhost:27017/"
mongodb.uri = "mongodb://localhost:27017/"
mongo.feedService.db = "feed-service"
mongo.dailies.collection = "dailies"
......@@ -7,7 +7,7 @@ mongo.questionService.db = "question-service"
mongo.questions.collection = "questions"
mongo.dailyQuestions.collection = "daily-questions"
# JWT Authenticationn
# JWT Authentication
jwt.privateKey = ""
# Daily Questions
......@@ -32,6 +32,9 @@ play.filters.enabled += play.filters.cors.CORSFilter
# Use a custom error handler to not return HTML views
play.http.errorHandler = "models.CustomErrorHandler"
# Control which modules are loaded when Play starts.
play.modules.enabled += Module
# --- Configuration Values to be replaced with environment variables, if present ---
mongodb.uri = ${?MONGO_URI}
jwt.privateKey = ${?JWT_PRIVATE_KEY}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment