In your project.clj
when declaring your Ring handler you can also specify an init (and destroy) function that is run when your application starts:
:ring {:init myproject.core/init
:destroy myproject.core/destroy
:handler myproject.core/handler}
This is documented here: https://github.com/weavejester/lein-ring#general-options