Search code examples
jarclojurering

How to run compojure rest server?


I've created a rest server with compojure and ring.

I can run it with 'lein ring server'. I can build it with 'lein uberjar'. But how to run this jar like java -jar my.jar ...?


Solution

  • You need to invoke lein ring uberjar to generate a self-start server you can run with

    java -jar target/uberjar/yourproject-0.1.0-SNAPSHOT-standalone.jar  
    

    I suggest you to use the standalone one to avoid dealing with dependencies

    Edited to include the specific command