faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
prutheus has joined #amber
<prutheus> Hey @faustinoaq are you there?
<FromGitter> <shobhitic> Any of you people working on a Mac? When I run `amber watch`, the firewall keeps asking me to "Allow" amber to accept incoming connections. How do I make it permanent? Kind of annoying to click it everytime I make any change in a file.
<prutheus> i work on mac book pro, and at me all is fine, i have nothing with firewall there
<FromGitter> <shobhitic> @prutheus Weird. This is what happens for me :-
<prutheus> strange, never had struggle with osx firewall. i need to leave now, sorry that i cant help
<FromGitter> <shobhitic> Not a problem.
<FromGitter> <shobhitic> Stupid question - How to start an amber app without watching for changes?
faustinoaq has joined #amber
<faustinoaq> Hi prutheus, I'm still working, I'll send you a PM later
<faustinoaq> @shobhitic, to start an amber app you should compile it first using `shards build myapp` and then run the generated binary `bin/myapp`
<faustinoaq> Tip: you can run any crystal app in this way
<FromGitter> <shobhitic> Wow, that never crossed my mind. Thanks!
<FromGitter> <shobhitic> I am sorry to ask so many questions, so feel free to not respond here. ⏎ ⏎ I am getting this error while compiling (for responding with JSON data) - ⏎ ⏎ ```code paste, see link``` ... [https://gitter.im/amberframework/amber?at=5b30cea37da8cd7c8c6ba340]
<FromGitter> <shobhitic> Yes, it's a String. @faustinoaq ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5b30d2e0ad21887018dc5b36]
<faustinoaq> @shobhitic Oh, @damianham I think new proc type in `respond_with` helpers just broke something
<faustinoaq> I require this: `json json_host.data.as(String | ProcType | Hash(Symbol | String, String))` to get json method working :/
<faustinoaq> ^^ @elorest
<faustinoaq> @shobhitic Can you open an issue about this? ;-)
<prutheus> hey faustinoaq but do you get it done? yes? nice
<FromGitter> <ok2094> I'm a bit confused about the granite `find_by`. I used it like the example in the docs `Post.find_by :slug, "example_slug"` but it's telling me that I gave it the wrong number of arguments (2) and that it expects 0.
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter> <AizuddinBadry> @faustinoaq i have new error while updating amber to v0.8.0 and crystal to v0.25.0
snsei has joined #amber
<FromGitter> <AizuddinBadry> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5b30f3ce0168e70c08ecefde]
snsei has quit [Remote host closed the connection]
snsei_ has joined #amber
snsei_ has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Remote host closed the connection]
snsei has joined #amber
snsei has quit [Remote host closed the connection]
<FromGitter> <paulcsmith> @eliasjpr @drujensen & rest of Amber team Care to join amber/discussion again? I'd love to chat about the comparison document for Amber & Lucky
<FromGitter> <damianham> @shobhitic, @faustinoaq it seems the test suite never tested calling the json method with a string, all test suite fixtures use ⏎ ⏎ ```json type: "json", name: "Amberator"``` [https://gitter.im/amberframework/amber?at=5b3104780168e70c08ed31ff]
<FromGitter> <damianham> you most likely need to specify the data type because the value could be Nil which isn't a valid data type for the json response ⏎ ⏎ ```json json_host.data.as(String)``` [https://gitter.im/amberframework/amber?at=5b3105287d3bca737a0898ae]
<FromGitter> <ok2094> What's the easiest way to authenticate a user for an api? Currently trying to get jwt to work.
<FromGitter> <damianham> jwt is very easy
<FromGitter> <damianham> it works well for me
<FromGitter> <ok2094> Aight, never done it before and new to crystal, so I'm a bit unsure on how to do it best.
snsei has joined #amber
<FromGitter> <damianham> there is an example in the react/preact_redux recipe for JWT authentication
<FromGitter> <damianham> look controllers/home_controller and pipes/authenticate_jwt
<FromGitter> <ok2094> sweet! thanks :)
snsei has quit [Ping timeout: 265 seconds]
wontruefree has joined #amber
<FromGitter> <robacarp> @paulcsmith amber/discussion?
<FromGitter> <paulcsmith> Yep, awhile ago there was a room for discussion Amber/Lucky integration and idea sharing, but it seems everyone left except for @elorest
<FromGitter> <paulcsmith> I'd be fine with a different room too. Just somewhere where we wouldn't clog the Lucky/Amber rooms while we're discussing internal stuff would be nice I think
<robacarp> happy to have some discussion, is it best to create a new room? I can't seem to re-invite myself to the existing one.
<FromGitter> <drujensen> @paulcsmith I’m here. Sorry for the late response.
<FromGitter> <drujensen> > comparison document for Amber & Lucky
<FromGitter> <drujensen> @eliasjpr mentioned we would be sharing whatever we could to reduce duplicate work
<FromGitter> <paulcsmith> @drujensen I think at first doing a chat to discuss what we want in the doc, and then we'd put it in https://github.com/crystal-loot/web-framework-comparison
<FromGitter> <paulcsmith> And yeah I'm working on moving a lib over to https://github.com/crystal-loot for sharing. Hopefully up by Friday but we'll see :)
<FromGitter> <drujensen> ok. Lets see if we can arrange a chat
<FromGitter> <paulcsmith> Sounds good. I'd be fine with the amber/discussion room, or some other room. Whatever you think is easiest for the Amber team
<FromGitter> <paulcsmith> I'll also add some issues to https://github.com/crystal-loot/web-framework-comparison with what I think would be good to cover
<FromGitter> <drujensen> yes, sounds good. I think a video chat would be good to get everyone on the same page
<FromGitter> <paulcsmith> That would be hard to do. I've been super busy and my evenings are pretty packed :(
<FromGitter> <drujensen> ok.
<FromGitter> <drujensen> Slack? ;=-)
<FromGitter> <robacarp> Haha
<FromGitter> <paulcsmith> IRC for sure
<FromGitter> <paulcsmith> That kind of outlines what I was thinking. We can discuss in that issue or more in-depth in chat
<FromGitter> <paulcsmith> Or we just chat here. Really up to you guys. I don't want to crowd your channel but if you are ok doing it here that works too. Whatever is easiest
<FromGitter> <drujensen> good start. I am fine either way.
<FromGitter> <paulcsmith> Ok let's chat here and if it becomes too much we can split it out into something separate. Does that sound like a plan?
<FromGitter> <drujensen> The performance question is right on.
<FromGitter> <drujensen> Unless we do something wrong, the performance should be very close
<FromGitter> <paulcsmith> My thought is that we can put ideas in that issue for things we want to cover. Once we have that outline set, both teams can create a markdown doc in that repo that has each of those points with a code sample, pros/cons, etc. We can then make a PR for them so each team can comment with questions/concerns, etc. Once we feel good about it where the docs are at, we can come up with a master document that combines
<FromGitter> ... them both. How does that sound?
<FromGitter> <drujensen> oh, i see. cool.
<FromGitter> <drujensen> then we can merge the two projects. :-D
<FromGitter> <drujensen> Do you have a template or should we just start answering the questions in a MD file?
<FromGitter> <paulcsmith> And really, if we agree on approaches for some stuff let's abstract some shared libs! I think that's the plan for LuckyFlow. I'll also extract a few others that we can share across frameworks. Maybe doing this pros/cons will help us settle on shared vision for other stuff too. And if not, at least people will have a clear idea of what the advantages and disadvantages are
<prutheus> @faustinoaq are you here?
faustinoaq has joined #amber
<faustinoaq> prutheus Yeah, I'm on lunch, I'll continue working in the project this afternoon, I'll send you a message later :)
<prutheus> faustinoaq: okay no problem, i just stay in here
<faustinoaq> Ok 👍
snsei has joined #amber
snsei has quit [Ping timeout: 245 seconds]
wontruefree has quit [Quit: this is not the client you are looking for]
wontruefree has joined #amber
<FromGitter> <ok2094> I'm doing this to check if all params are included, but where can I return the param errors? ```before_action do ⏎ ⏎ ```only :create { create_params.validate! } ⏎ only :login { login_params.validate! }``` ⏎ ⏎ end``` ... [https://gitter.im/amberframework/amber?at=5b314914ad21887018ddb6b2]
<FromGitter> <ok2094> huh markdown doesn't work 😟
<FromGitter> <ok2094> How do I handle file uploads? The example in the docs is not very clear. Currently getting a `Failed to parse multipart message` error.
prutheus has quit [Quit: Page closed]
<faustinoaq> @ok2094 Can you share some of your code? :)
<FromGitter> <ok2094> Which code?
<faustinoaq> @ok2094 What do you mean by "markdown doesn't work" ?
<FromGitter> <ok2094> Just the gitter markdown
<faustinoaq> @ok2094 Oh ok :)
<faustinoaq> "I just get the whole server error as response.", This a known bug reported on https://github.com/amberframework/amber/issues/770 and fixed by https://github.com/amberframework/amber/pull/864 (WIP)
<FromGitter> <ok2094> Currently trying to get a file form a Java client app and really struggling with it. I get it as a multipart form-data
<FromGitter> <ok2094> I see thanks
<faustinoaq> @ok2094 Are you able to do file uploads using other simple crystal web framework like Kemal? http://kemalcr.com/cookbook/file_upload/
<faustinoaq> Just to be sure the file upload issue isn't a Crystal issue ;-)
<FromGitter> <ok2094> I didn't try that yet
<faustinoaq> Ok, I mean to check if is a crystal or amber issue ;-)
<FromGitter> <ok2094> I think its more of a my code issue, because I don't have a clear idea of what I'm supposed to do lol
<faustinoaq> Oh ok xD
<FromGitter> <ok2094> What does `params.files["file"]` do?
<faustinoaq> Fetch form files, `files` is a getter on `Params` class, see source code here: https://github.com/amberframework/amber/blob/master/src/amber/router/params.cr#L35
<faustinoaq> It returns a multipart (hash of string data) or files (hash of router files)
<faustinoaq> @eliasjpr we really need to document Amber's source code and publish an API page like crystal does :)
<faustinoaq> Something like this https://crystal-lang.org/api
<FromGitter> <ok2094> nice, then I should be fine. I think the issue is client side.
<faustinoaq> @ok2094 Can you reproduce it with Kemal?
<FromGitter> <ok2094> currently tweaking the client, will try if that fails :)
<faustinoaq> Oh ok :)
faustinoaq has quit [Quit: IRC client terminated!]
<FromGitter> <eliasjpr> @faustinoaq waiting for it to be stable enough
wontruefree has quit [Quit: bye]