Leiningen template for a clojure based HTTP service. Following libraries are preincluded:
To create a new service, add the following to your lein ~/.lein/profiles.clj
{:user {:plugins [[clj-service/lein-template "LATEST"]]}}
After this you can create the service with:
lein new clj-service <project-name>
This will prompt for base path and port number of the service. Base path is where you main code will lie. For e.g passing com/sdslabs
with name lens
will create all code in src/com/sdslabs/lens
.
Example:
lein new clj-service lens
Every service should have a unique port locally so that you can run more than one service locally.
Your service consists of three functions:
initialize!: Sets up the global state.
Handler function: Takes the request
destroy: Destroys global state.
Distributed under the Apache License, Version 2.0