play-vue-webpack
play-vue-webpack copied to clipboard
Reading Configuration by parseFile seems to be wrong
Reading Configuration by parseFile seems to be wrong and it also throws exception when running Stage. I'd suggest to:
- Insert
include "frontend.conf"
at the end ofapplication.conf
file - Replace:
class FrontController @Inject() (cc: ControllerComponents, env: Environment) extends AbstractController(cc){
val config: Config = ConfigFactory.parseFile(new File("conf/frontend.conf")).resolve()
def index = Action {
Ok(views.html.index.render(env, config.getInt("webpack.port"), WebpackBuildFile.jsBundle, WebpackBuildFile.cssBundle))
}
}
with
class FrontController @Inject() (cc: ControllerComponents, env: Environment, config: Configuration) extends AbstractController(cc){
def index = Action {
Ok(views.html.index.render(env, config.get[Int]("webpack.port"), WebpackBuildFile.jsBundle, WebpackBuildFile.cssBundle))
}
}