1

I am wondering if it is possible to edit source code directly on the server and immediately see changes to the app, or, the next best thing to this in the Clojure workflow would be... ?

I have seen these pages:

From what I understand, what I want to do cannot be done since Heroku is read-only and you must push a finished git repo to the server to see updates. This was fine when most of my work was in ClojureScript, but now I'm adding databasing server-side and want that same level of instant feedback to source code.

What is the best way to go about this? Am I limited to pushing source code but only testing databasing strategies using the command line REPL outside my source files?

Community
  • 1
  • 1
johnbakers
  • 24,158
  • 24
  • 130
  • 258

1 Answers1

2

You do not need to edit the source code on Heroku to modify your Clojure application.

You can connect to your application via nREPL and evaluate any forms within the context of your already running application.

The first link that you provided (https://devcenter.heroku.com/articles/debugging-clojure), looks like it correctly describes how to do this in a Heroku context.

Keep in mind that many operations (e.g. redefining a root var) are not recommended on a live running application. More information here:

Is defn thread-safe?

If you want any changes that you made via nREPL to persist across application restarts you would need to make those changes you want to retain to your original source and git push again.

Community
  • 1
  • 1
Symfrog
  • 3,398
  • 1
  • 17
  • 13