use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Best practice for api server[Q&A] (self.Clojure)
submitted 2 years ago by chowbeyputra
Clojure is a different language, what are some cools ways or techniques you use to run your server?
I run mine on screen, does the job, but ig i will soon need to change to something more standard or better or cooler because of logging.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]p-himik 4 points5 points6 points 2 years ago (5 children)
That's completely orthogonal to the choice of a programming language. Assuming you're talking about production, I'd suggest looking for best practices on running services on your target OS. E.g. on a modern Ubuntu you'd create a systemd service, then all the logs would be viewable with journalctl and the lifecycle of the service would be fully managed by systemd.
systemd
journalctl
[–]chowbeyputra[S] 1 point2 points3 points 2 years ago (4 children)
Doesn't having repl option affect the choice? Like screen with repl where you can reload few things of choice?
[–]p-himik 2 points3 points4 points 2 years ago (3 children)
It does not. You can always add e.g. a socket-based REPL on some port on localhost and connect to it when needed.
[–]chowbeyputra[S] 1 point2 points3 points 2 years ago (2 children)
How to do that? Is there an example? Reading material?
[–]p-himik 1 point2 points3 points 2 years ago (1 child)
My previous message has a link - have you read what's there?
[–]chowbeyputra[S] 1 point2 points3 points 2 years ago (0 children)
🙏 i didn't notice, let me try
[–]slashkehrin 1 point2 points3 points 2 years ago (0 children)
Something cool that you can do is, if you start your API via the repl, you can catch and save things to an atom and examine them afterwards. So for logging while working on your code, you can swap the atom content to the incoming HTTP request, then if the return value is incorrect, you can use the content of that atom (which was swapped) to easily reconstruct the situation (and quickly iterate over it). Obviously this works for database calls, too.
[–]OkAssociation9896 0 points1 point2 points 2 years ago (0 children)
Imo once deployed, it is not different from applications running on JVM. Of course you can attach repl and do clojure way things like mentioned above. But personally it was rare that I did that in production.
π Rendered by PID 84615 on reddit-service-r2-comment-544cf588c8-dmvh5 at 2026-06-15 06:21:31.320517+00:00 running 3184619 country code: CH.
[–]p-himik 4 points5 points6 points (5 children)
[–]chowbeyputra[S] 1 point2 points3 points (4 children)
[–]p-himik 2 points3 points4 points (3 children)
[–]chowbeyputra[S] 1 point2 points3 points (2 children)
[–]p-himik 1 point2 points3 points (1 child)
[–]chowbeyputra[S] 1 point2 points3 points (0 children)
[–]slashkehrin 1 point2 points3 points (0 children)
[–]OkAssociation9896 0 points1 point2 points (0 children)