play-vue-webpack icon indicating copy to clipboard operation
play-vue-webpack copied to clipboard

Reading Configuration by parseFile seems to be wrong

Open eximius313 opened this issue 6 years ago • 0 comments

Reading Configuration by parseFile seems to be wrong and it also throws exception when running Stage. I'd suggest to:

  1. Insert include "frontend.conf" at the end of application.conf file
  2. 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))
  }
}

eximius313 avatar Nov 02 '17 22:11 eximius313