diff --git a/revel/skeleton/app/init.go b/revel/skeleton/app/init.go index cca1b81..fb1d79a 100644 --- a/revel/skeleton/app/init.go +++ b/revel/skeleton/app/init.go @@ -29,7 +29,11 @@ func init() { revel.ActionInvoker, // Invoke the action. } - // register startup functions with OnAppStart ( order dependent ) + + // register startup functions with OnAppStart + // revel.DevMode and revel.RunMode only work inside of OnAppStart. See Example Startup Script + // ( order dependent ) + // revel.OnAppStart(ExampleStartupScript) // revel.OnAppStart(InitDB) // revel.OnAppStart(FillCache) } @@ -45,3 +49,11 @@ var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) { fc[0](c, fc[1:]) // Execute the next filter stage. } + +func ExampleStartupScript() { + // revel.DevMod and revel.RunMode work here + // Use this script to check for dev mode and set dev/prod startup scripts here! + if revel.DevMode == true { + os.Setenv("SOME_ENV_VAR", "VALUE") + } +}