perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

staticFiles.externalLocation from before filter #993

Closed randohinn closed 5 years ago

randohinn commented 6 years ago

Hello

Is there a way to use staticFiles.externalLocation from inside a before filter? Currently, this gives me a This must be done before route mapping has begun error.

Use case: my before filter determines the subdomain that has been hit, and needs to set the static directory based on that.

randohinn commented 6 years ago

@perwendel ?

tipsy commented 6 years ago

No, it's a configuration option, it has to be done before server start. The server is automatically started upon route mapping.