Fork me on GitHub
#yada
<
2017-09-24
>
Zor20:09:39

greetings ! I'm looking to "Get Started" with yada-lean, but the User Guide points me to juxt/edge - which is way too packed with stuff for my sunday evening endeavor

dominicm20:09:11

@zor the important example on edge is the component I think

Zor20:09:05

I'm reading through web_server.clj at the moment

Zor20:09:08

thanks for the pointer !

Zor20:09:47

component.clj isn't a thing. what is the important example on edge you say ?

malcolmsparks20:09:44

That's the crud thing worth understanding

Zor20:09:28

the component is named system

Zor20:09:44

(followed its smell from main.clj

Zor20:09:43

the fact that I'm a lein guy that doesn't know much about boot yet adds to the time it takes me to get a simple yada-lean webserver up and running 🙂 not to mention the component scaffold I'm also getting aquainted with

Zor20:09:59

what is the ext folder in yada repo ? I see lots of stubbed? project.clj files

malcolmsparks20:09:55

Extensions. Yada has a small core and the functionality is built out with extensions.

Zor21:09:05

from my perspective, no way to understand Yada or Yada exemples without understanding stuartsierra/component first

Zor21:09:02

Regarding Basics, Introduction part of the manual it says "It achieves this by providing you with a highly-configurable handler that is general enough to use in the vast majority of cases. Rather than coding the handler, the developer only has to configure one. This declarative approach provides greater scope for accuracy, consistency and re-use."

Zor21:09:59

am I correct in my understanding that this declarative approach is powered by stuartsierra/component ?

Zor21:09:46

after cloning the yada repo, and starting the dev system using (dev) then (go), hitting will only serve 404 not founds whereas will serve the manual

Zor21:09:20

I'm not sure if that's a bug or something I did wrong

danielcompton21:09:42

@zor you can treat yadas server just the same way you would a jetty one, so defing it will work fine

danielcompton21:09:58

You just some nice properties from component, but it's not essential to Yadaitself

danielcompton21:09:23

Nope, this is by declaring a yada/resource and filling in the blanks about which methods the resource supports, how to fetch properties, e.t.c. From that small description, yada can generate rich behaviour that matches the HTTP spec, including authorization, authentication, caching, good error messages, validation, e.t.c.

Zor21:09:53

oh okay daniel thanks

Zor21:09:17

that's the meat of it yes, what the manual talks about in good details - I've mostly skimmed so far

Zor21:09:28

@danielcompton how do I serve this yada resource or otherwise play with it from the REPL ?

Zor22:09:26

aaww. 4.3.1. Serving resources

Zor22:09:41

we got HELLO WORLD running 😄 wooo!