Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 20 08:32
    vladfaust transferred #85
  • Sep 20 08:32
    watzon opened #25
  • Sep 19 23:51
    watzon opened #85
  • Aug 25 17:33
    t-richards opened #84
  • Aug 13 11:21
    vladfaust closed #7
  • Aug 13 11:19
    vladfaust closed #108
  • Aug 13 11:19
    vladfaust closed #109
  • Aug 13 11:17
    vladfaust closed #24
  • Aug 09 08:46
    vladfaust review_requested #109
  • Aug 09 08:46
    vladfaust review_requested #7
  • Aug 08 20:13
    arubinofaux opened #7
  • Aug 08 20:13
    arubinofaux opened #109
  • Aug 02 11:31
    RemiKalbe edited #24
  • Aug 02 11:29
    RemiKalbe opened #24
  • Aug 01 12:52
    RemiKalbe edited #83
  • Aug 01 12:51
    RemiKalbe opened #83
  • Jul 30 18:36
    vladfaust closed #23
  • Jul 30 18:33
    vladfaust transferred #82
  • Jul 30 18:33
    RemiKalbe opened #23
  • Jul 30 15:55
    RemiKalbe opened #82
Jack
@wontruefree
I think so
Adrian Madrid
@aemadrid
+1
Jack
@wontruefree
amber framework pushes the regex sanitation down to the node level
in onxy that is an endpoint
so it might make sense to have something on the endpoint
but that is probably more for vlad to figure out
Vlad Faust
@vladfaust
What's the usecase?
Marwan Rabbâa
@waghanza
@vladfaust I wish to add an endpont that match only on /user/1 and not /user/foo
Vlad Faust
@vladfaust
Usually you'd have path param id : Int32 which would return 400 error
I'm trying to find specs to prove that having two identical routes with regex limitations is bad
Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical.
Onyx Router relies on https://github.com/luislavena/radix, and it does not support Regexes.
Vlad Faust
@vladfaust
But honestly I had ideas on creating binding for r3, which would allow faster routing and matching regexes
Vlad Faust
@vladfaust
Well, no: c9s/r3#118
Vlad Faust
@vladfaust
Upd: the issue above is not relevant (the author forgot brackets). But r3 still lacks in wildcard support
Adrian Madrid
@aemadrid
I can think of a usecase where you want to format the param as a string, say a UID
Marwan Rabbâa
@waghanza
uuid, no ?
Adrian Madrid
@aemadrid
sure
Adrian Madrid
@aemadrid
not a big deal though
Ed
@drum445
@vladfaust do you have a sample project of using MySQL without an orm, just the crystal-mysql lib?
Vlad Faust
@vladfaust
No, I don’t use MySQL at all
Adrian Madrid
@aemadrid
@vladfaust what’s up with Onyx?
Vlad Faust
@vladfaust
What’s up with it? It’s still MIT and got updates in its development branches
Vlad Faust
@vladfaust
There is nothing critical to fix or ship, so I’m not in hurry here. If you’re concerned about testing, it will be done soon. It’s still possible to test endpoints without much problem using fibers
Jack
@wontruefree
will there be a paid structure for Onyx like Worcr? And if you are apart of one will if carry over to the other?
Vlad Faust
@vladfaust
I had some ideas of having a commercial functionality for Onyx. Mainly related to authentication
But almost all features will be still MIT. Onyx would act as an advertiser for Worcr, so they'd depend on each other
Jack
@wontruefree
does onxy/sql have transactions?
Vlad Faust
@vladfaust
@wontruefree Onyx::SQL doesn't need transactions on its own, as they're supported by crystal-db. However, there is a proposal for prettier API for Onyx itself -- onyxframework/onyx#14
Vlad Faust
@vladfaust

You can preview the next Onyx::EDA at v0.3.0-rc.1. Its API is updated too -- https://api.onyxframework.org/eda/index.html.

Onyx::SQL got a sweet new 0.7.2 release as well.

Onyx::HTTP is patched too.

I'm looking forward for the next Onyx release (0.4.0), which would include new API, testing helpers and new EDA version support

Vlad Faust
@vladfaust
Gonna update docs and blogposts and then release 0.4.0
Muhammed Yaşar
@yorci
Hi @vladfaust , do you have any nosql odm plan in the future?
Vlad Faust
@vladfaust
@yorci No, I don't think so. NoSQL has no standard and I see no point in supporting certain database drivers
Muhammed Yaşar
@yorci
i see
Lairan
@alex-lairan

NoSQL has no standard, but some subset have standard.

Key Store have (a kind of) standard for example.

Daniel Sokil
@s0kil
Since there are so many of NoSQL DB's, it would be ideal to provide easier integration with the DB of choice.
BlobCodes
@BlobCodes_gitlab
Hello, does anyone know how to use the StaticFileHandler with Onyx ?
Vlad Faust
@vladfaust

Yes, that docs section is still TODO. Onyx::HTTP.listen method has a block to yield (https://github.com/onyxframework/onyx/blob/master/src/onyx/http.cr#L69). You have access to handlers within the block:

Onyx::HTTP.listen do
  pp handlers
end

Handlers is an array, you can modify it as you want, adding or removing custom handlers if needed.

BlobCodes
@BlobCodes_gitlab
Thanks!
Vlad Faust
@vladfaust
My pleasure :)
BlobCodes
@BlobCodes_gitlab

Hmm..
When I try to do this:

spawn do
  Onyx::HTTP.listen do
    handlers.push(HTTP::StaticFileHandler.new("./public",false,false))
  end
end

..the StaticFileHandler makes every page show up as text.
Looks like this:

[some style stuff, etc.]
<body>
<div class="code">404</div>
<h1 class="status-message">Not Found</h1>
  <div class="request-id">Request ID: a53ba92e-3a81-4abf-8252-fb228f560f5e</div>
</body>
</html>
Not Found

(only works in release mode, segfaults in non-release mode)

What can I do so the StaticFileHandler doesn't append that "Not Found" ?

BlobCodes
@BlobCodes_gitlab
I now resolved the segfault issue, but the "Not Found" is still there.. huh..
Vlad Faust
@vladfaust
I guess you have put the handler before router
‘pp handlers’ to see actual handlers and then insert your handler somewhere. Experiment with the best placement for it. You can do ‘handlers.insert(n, your_handler)’ for precision
BlobCodes
@BlobCodes_gitlab
Thanks!
Now everything works like a charm!
Marwan Rabbâa
@waghanza
@vladfaust in https://github.com/onyxframework/http/blob/master/src/onyx-http/middleware/renderer/rest_error.html.ecr we have ::HTTP::Status.new(500)
when trying to compile I have in lib/onyx-http/src/onyx-http/middleware/renderer/rest_error.html.ecr:4: undefined constant ::HTTP::Status
Vlad Faust
@vladfaust
@everyone recent dependency renaming led to colossal failures due to crystal-lang/shards#272. You should avoid using shards install for now.