This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-09
Channels
- # admin-announcements (6)
- # arachne (3)
- # beginners (66)
- # boot (84)
- # braveandtrue (1)
- # cider (84)
- # cljs-site (1)
- # cljsjs (3)
- # cljsrn (2)
- # clojure (138)
- # clojure-austin (2)
- # clojure-czech (1)
- # clojure-gamedev (6)
- # clojure-germany (15)
- # clojure-italy (2)
- # clojure-russia (26)
- # clojure-uk (51)
- # clojurescript (97)
- # css (1)
- # cursive (1)
- # datascript (13)
- # datomic (6)
- # devcards (2)
- # docker (1)
- # emacs (5)
- # hoplon (9)
- # immutant (5)
- # jobs (4)
- # leiningen (6)
- # luminus (27)
- # mount (4)
- # om (16)
- # om-next (4)
- # onyx (15)
- # other-languages (36)
- # overtone (1)
- # proton (3)
- # quil (1)
- # re-frame (11)
- # reagent (24)
- # rum (4)
- # spacemacs (3)
is it possible to run grimoire completely locally?
@arrdem there are directions in https://github.com/clojure-grimoire/grimoire/blob/master/README.md ? Specifically, I'm interested in running the grimoire app without needing a continuous internet connection to http://www.conj.io
@jonschoning: https://www.conj.io/contributing under "Building & Running".
Yeah you can do that, although running a local webapp probably isn't that power efficient. I've thought in the past about building a more efficient lib-grimoire derived local/repl client but haven't had time/interest/motivation.
If one were so motivated, there's probably some work that could be done to disable stuff like the analytics javascript and server components in a "run locally" context. But right now it's all always on.
@arrdem I had no problem with make setup; lein serve
to run the server - I do see the default "search" page but all the links still point to http://www.conj.io
@jonschoning: lein with-profile dev run -m grimoire.web.service
should do it.
if you look at the project.clj
, the serve
alias is jut defined to be lein run
with the server
profile, which sets the site's base url to be
ahh, that did the trick, thanks!!
Sure! You're on a very short list of people who've tried to run Grimoire themselves, let me know if you have any problems.
thanks; appreciate the assistance
Also remember to do the make setup
otherwise you won't have any data files to serve from.
hi, app needs ":main" in project, some tutor tell define it like ":main myproject.core" but in project directory i can not find .core file, how to solve this?
this happens when i deploy my app to heroku
@agi_underground: have you got a myproject/core.clj
file in your project? Are you using lein uberjar
to build this and then running it using java -jar <uberjar name.jar>
?
Where you substitute your project namespace for myproject
and the name of the uberjar generated by lein uberjar
for <uberjar name.jar>
no i not have core.clj
That's why the :main myproject.core
doesn't find anything
it's looking for a namespace myproject.core
in a file core.clj
in a dir myproject
with a fn -main
This -main
fn bootstraps your application
Your -main
doesn't have to be in a namespace called core
it can be in any ns but whatever you pick needs to be referenced by :main
in project.clj
when i deploy project to heroku, service themeself build and run project. What i need to do, for specify :main ?
you can even have the fn called something else
maybe init[]
in handler.clj
project type is compojure app
I haven't deployed to Heroku for ages
are you following a tutorial
and when i run lein ring server locally, they work good
without any :main
That's because your using the 'lein ring' plugin
heroku is not
maybe i need to declare main func someware in handler? make wrapper for init func?
Heroku is expecting an uberjar with everything packaged as a jar (I expect, I can't tell without knowing what commands you are using)
That would work if you add a fn (call it -main
for conventions sake) and then reference it in the :main
in the project.clj
but you probably need to uberjar it
How is Heroku running your app?
width command "lein trampoline run"
Ahh, OK.
So that expects a :main
to reference a ns with a -main
fn
error from server log - Exception in thread "main" java.lang.ClassNotFoundException: myproject.core
so if you call your init
from -main
and then reference the ns that has your -main
in it in the project.clj
for example, I put my -main
in mywebapp.handler
Try lein new app ... then see the project clj and core.clj it help me alot when trying to understand :main
and add :main mywebapp.handler
debug by running lein run
or lein trampoline run
locally
when that works locally it will work in Heroku
Here's a Heroku tutorial that walks through running it as an uberjar https://devcenter.heroku.com/articles/clojure-web-application
if i wanted to include a util lib of mine among a couple different projects, what's my best move? Add my github repo to project.clj
somehow? Clone it somehwere, and alter my classpath? Will it get wrapped up in the uberjar when it's built? (Thanks!!!)
...follow-up: Can I just check out my repo to ~/src/my-lib
and use :source-paths
to "include" it (i'm coming from python, where i'd just fiddle with sys.path
if i really had to during dev)
https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md#checkout-dependencies
i found https://github.com/tobyhede/lein-git-deps i guess
is there a way to make an xhr requests that uses xml
as its body instead of json
. I couldn’t find how to do this with clj-http.
i`m here, and i`m have question) how i can handle postgres exceptions like HTTP ERROR 500, that display my connection data(username db-name)?
i`m try like this: (try (sql/with-query-results res ["select * from users where id = ?" id] (first res)) (catch Exception _ {:status 400 :body "Invalid data"}))))