jacekschae / learn-reitit-course-files

🎦 Learn Reitit course files for building Cheffy REST API
https://www.learnreitit.com
38 stars 16 forks source link

Deploying to Heroku problems #11

Closed antifessional closed 3 years ago

antifessional commented 3 years ago

I'm trying to follow the initial deployment to heroku. The only difference is that I use a namespace with an additional level : toplevel.cheffy.server. The only way I was able to make it work is with Procfile

web: lein with-profile production trampoline run

(the production profile does not exist)

Locally the file runs correctly with many commands:

java -cp target/cheffy.jar clojure.main -m toplevel.cheffy.server "resources/config.edn" 
java -jar target/cheffy.jar clojure.main -m toplevel.cheffy.server "resources/config.edn" 
java -jar target/cheffy.jar  "resources/config.edn"
lein with-profile production trampoline run -m toplevel.cheffy.server

But on heroku all but the first command result in

Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which

Can you please advise?

jacekschae commented 3 years ago

I have 3 things, not sure if any will work:

  1. Towards the end of the course there is another deployment lesson. There were a couple of things that I reworked.

  2. Maybe you could try to keep the following? https://github.com/jacekschae/learn-reitit-course-files/blob/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/07-heroku-deploy/src/cheffy/server.clj#L2

  3. Also try lein clean and then try again?

Hope that helps, probably start from the bottom.

antifessional commented 3 years ago

Thank you! I redid everything exactly the same way and this time got it to work.