!nUoTgEvlAqyrKwctnB:matrix.org

macchiato

86 Members
Macchiato framework for ClojureScript and Node https://github.com/macchiato-framework25 Servers

Load older messages


SenderMessageTime
6 Jan 2021
@_slack_clojurians_UGMEQUCTV:matrix.orgvishal.gautam Hello 16:35:40
@_slack_clojurians_UGMEQUCTV:matrix.orgvishal.gautam I am try to implement automatic code reloading in my macchiato app. I am following the guestbook tutorial 16:36:57
12 Jan 2021
@donald:hope.net@donald:hope.net left the room.18:03:16
16 Feb 2021
@tamara:nltrix.net@tamara:nltrix.net 08:12:35
@tamara:nltrix.net@tamara:nltrix.net removed their display name tamara.08:13:45
@tamara:nltrix.net@tamara:nltrix.net left the room.10:59:32
19 Aug 2021
@andreas:server.matrix4ulm.de@andreas:server.matrix4ulm.de 19:10:28
@andreas:server.matrix4ulm.de@andreas:server.matrix4ulm.de removed their display name andreas.19:11:25
@andreas:server.matrix4ulm.de@andreas:server.matrix4ulm.de left the room.19:22:16
25 Sep 2021
@_slack_clojurians_U0NBGRGD6:matrix.orgdoglooksgood joined the room.07:46:33
@_slack_clojurians_U0NBGRGD6:matrix.orgdoglooksgood Hi, is there a stop server function in macchiato? 07:46:33
@_slack_clojurians_U662GKS3F:matrix.orgnenadalm hi. start fn returns server: https://github.com/macchiato-framework/macchiato-core/blob/master/src/macchiato/server.cljs#L35 that you can close using close method: https://nodejs.org/dist/latest-v14.x/docs/api/http.html#http_server_close_callback 12:38:14
@_slack_clojurians_U0NBGRGD6:matrix.orgdoglooksgood I see, the server is the server start with http module. Thank you! 13:18:05
6 Oct 2021
@slackbot:matrix.orgSlack Integration 08:32:59
27 Jan 2022
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee joined the room.03:41:53
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee GMEQUCTV if you found a way to implement automic code reloading in the macchiato app i would love to hear it. My theory is that ill be stopping the server then loading the changes, then starting the server. I'm actually not sure i need this to bad sense i don't think my routes will change very often, but it would be nice to have. 03:41:53
@_slack_clojurians_U662GKS3F:matrix.orgnenadalm I didn't touch my demo app for a while but I believe that reloading routing worked for me. The way I did it is that on each request I just recreated the router though if debug was on: https://github.com/nenadalm/spa-demo/blob/master/server/src/app/routes.cljs#L138 17:23:56
@_slack_clojurians_U662GKS3F:matrix.orgnenadalm maybe it could be also done via mount: https://github.com/tolitius/mount#recompiling-namespaces-with-running-states if the server was it's component. 17:25:12
28 Jan 2022
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee thanks for the follow up. How could you re-create the router if the server was running? wouldn't it complain about the port already being taken? 01:31:03
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee Or are you just referring to the router, and not the running server process? 01:31:22
@_slack_clojurians_U662GKS3F:matrix.orgnenadalm > Or are you just referring to the router, and not the running server process? exactly. by router I meant reitit router. Here it gets created on each request: Or are you just referring to the router, and not the running server process? 16:27:16
29 Jan 2022
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee I guess maybe you don't need to restart the server if you can update the program it's um calling out to? 04:16:12
@_slack_clojurians_U0NBGRGD6:matrix.orgdoglooksgood How can I extend transit writer for wrap-restful-format, the document is not clear to me. It asked for {:type .. :opts ...}, where can I find their definitions? 09:40:26
@_slack_clojurians_U0NBGRGD6:matrix.orgdoglooksgood I finally got something like this
(def transit-opts
  {:writer
   {:opts
    {:handlers
     {js/BigInt (transit/write-handler (constantly "N") str)}}}})
But it does not work.
09:54:28
31 Jan 2022
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee Why would a macchiato server handler that consumes a promise inside a go block like this
(fn [request respond] (go (respond  ( 
result in an error about the stream write happening after end? I'm unsure what respond is doing, noly that it should be passed a hashmap with the response schema (body, status, etc...). I assume  Error [ERR_STREAM_WRITE_AFTER_END] [ERR_STREAM_WRITE_AFTER_END]: write after end
    at new NodeError (node:internal/errors:329:5)
    at write_ (node:_http_outgoing:751:11)
    at ServerResponse.write (node:_http_outgoing:710:15)
    at /home/drewverlee/archmedx/kyber/server/dev/out/cljs-runtime/macchiato/http.cljs:110:5
    at /home/drewverlee/archmedx/kyber/server/dev/out/cljs-runtime/macchiato/http.cljs:106:10
    at respond_SINGLEQUOTE_ (/home/drewverlee/archmedx/kyber/server/dev/out/cljs-runtime/reitit/ring.cljc:119:43)
    at respond__$1 (/home/drewverlee/archmedx/kyber/server/dev/out/cljs-runtime/macchiato/middleware/restful_format.cljs:110:24)
    at switch__45133__auto__ ( eval :75:27)
    at  eval :212:29
    at Function.server$core$state_machine__45134__auto____1 [as cljs$core$IFn$_invoke$arity$1] ( eval :234:4)  
17:23:15
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee In the example here https://macchiato-framework.github.io/docs/getting-started the handler calls the function which would block (db call) and passes it a function which function which would then get the results and pass it to the handler. I'll have to think about that.. 19:59:59
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee This disucssion on proposal to add async handlers seems educational in this direction https://www.booleanknot.com/blog/2016/07/15/asynchronous-ring.html it allows the channel to be used as responce body... lets try that lol 20:23:54
@_slack_clojurians_U0DJ4T5U1:matrix.orgdrewverlee likely i'm going to have more luck using reitit-siparri then middlware, thats also what the rest of my application uses... 21:59:42
27 Feb 2022
@thingographist:matrix.orgЕвгений Соловьев joined the room.16:07:43
18 Apr 2022
@wybpip:matrix.org@wybpip:matrix.org joined the room.08:57:59

Show newer messages


Back to Room ListRoom Version: