00:07:39  * bmacjoined
00:18:47  * raboidjoined
00:21:26  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
00:55:38  * bmacjoined
01:06:24  * dead_horsejoined
01:08:51  * kazuponjoined
01:13:57  * joshonthewebjoined
01:19:37  * mhernandez1joined
01:22:09  * mhernandez1quit (Read error: Connection reset by peer)
01:22:10  * mhernand_joined
01:29:43  * kievechuajoined
01:38:07  * kazuponquit (Remote host closed the connection)
01:38:34  * kazuponjoined
01:38:56  * LeXXikjoined
01:40:09  * kazupon_joined
01:41:01  * kazuponquit (Remote host closed the connection)
01:56:53  * mhernand_quit (Remote host closed the connection)
01:56:54  * joshonthewebquit (Quit: Computer has gone to sleep.)
02:18:15  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:22:04  * raboidquit (Remote host closed the connection)
02:36:36  * TheAceOfHeartsjoined
02:44:25  * oscargodsonquit (Quit: Computer has gone to sleep.)
02:44:46  * TheAceOfHeartspart
03:11:59  * wilmoorejoined
03:19:04  * occultusjoined
03:38:37  * kazupon_quit (Remote host closed the connection)
03:39:07  * kazuponjoined
03:43:46  * kazuponquit (Ping timeout: 264 seconds)
03:59:41  * kievechuaquit (Quit: kievechua)
04:05:23  * basicdaysjoined
04:10:45  * kazuponjoined
04:23:07  * basicdaysquit (Quit: I'm out)
04:31:01  * wilmoorequit (Ping timeout: 255 seconds)
04:40:44  * wilmoorejoined
04:58:52  * kievechuajoined
05:01:10  * oscargodsonjoined
05:04:16  * oscargod_joined
05:07:54  * oscargodsonquit (Ping timeout: 260 seconds)
05:10:37  * occultusquit (Quit: restarting)
05:11:04  * occultusjoined
05:23:36  * oscargod_quit (Quit: Computer has gone to sleep.)
05:55:17  * xiaobincxbjoined
06:00:38  * wilmoorequit (Ping timeout: 250 seconds)
06:01:04  * occultusquit (Disconnected by services)
06:01:43  * occultusjoined
06:09:28  <xiaobincxb>Excuse me, what is the differences between Koa middleware and connect middle? I only know that Koa middlewares are base on yield, but what is the advantage of it? I cannot google any article about this.
06:28:01  <dead_horse>you can compare these tow response-time middleware, https://github.com/koajs/response-time/blob/master/index.js and https://github.com/expressjs/response-time/blob/master/index.js.
06:35:20  * wilmoorejoined
06:41:11  * wilmoorequit (Remote host closed the connection)
06:42:34  * xiaobincxbquit (Ping timeout: 264 seconds)
06:46:08  * wilmoorejoined
06:56:07  * wilmoorequit (Read error: Connection reset by peer)
07:03:15  * wilmoorejoined
07:14:29  * joshonthewebjoined
07:21:17  * kievechuaquit (Quit: kievechua)
07:27:31  * kievechuajoined
08:02:18  * occultusquit (Quit: Leaving)
08:02:57  * kazuponquit (Remote host closed the connection)
08:03:24  * kazuponjoined
08:07:43  * dead_horsequit (Remote host closed the connection)
08:07:56  * kazuponquit (Ping timeout: 250 seconds)
08:24:02  * dead_horsejoined
08:47:26  * raboidjoined
09:09:19  <raboid>When I'm organizing logic into separate modules how do I get access to the koajs this context within them?
09:10:25  * __quimjoined
09:12:32  * kazuponjoined
09:13:45  * kievechuaquit (Quit: kievechua)
09:36:57  * McJesuschanged nick to JohnRolomo
09:52:15  * kazuponquit (Remote host closed the connection)
09:58:40  * raboidquit (Remote host closed the connection)
09:59:20  * raboidjoined
10:03:46  * raboidquit (Ping timeout: 260 seconds)
10:09:22  * wilmoorequit (Ping timeout: 245 seconds)
10:19:51  * dead_horsequit (Remote host closed the connection)
10:34:26  * raboidjoined
10:34:28  * dead_horsejoined
10:37:08  <LeXXik>hi raboid just use this keyword?
10:38:46  <raboid>yeah I wasn't using app.use properly. Also how would you set it up so that every request hits a router that routes it to the needed function based on a json param? I know koa-route/r does this with the url, but I can't figure out how it's implemented. I don't want to have to every request cascade through all my possible middleware
10:39:10  <raboid>so i guess how do you pass control off to a specific piece of middleware
10:40:33  <LeXXik>that's the job of a router
10:41:36  <LeXXik>you can parse your request before passing it to the router, if you don't want the router to automatically find and match the path
10:43:03  <LeXXik>the default search&matching works fine for me though, I can give you a snippet of my router middleware
10:44:10  <raboid>okay thanks, I'm just confused on the semantics of how to pass control off to another module from within my router module
10:48:18  <LeXXik>https://gist.github.com/LeXXik/bd5e1a00b645a89ab722
10:48:38  <LeXXik>need to go now, you can leave your question in the gist
10:48:51  * LeXXikquit (Quit: Leaving)
10:49:53  * joshonthewebquit (Quit: Computer has gone to sleep.)
10:50:19  <raboid>ah yeah so I understand how to do it with the already made router middleware. But I want to do routing in my application based on a param in the json being posted, not the url's.
10:56:36  * joshonthewebjoined
11:08:54  * joshonthewebquit (Quit: Computer has gone to sleep.)
11:24:00  * joshonthewebjoined
11:27:12  * __quim_joined
11:30:06  * __quimquit (Ping timeout: 260 seconds)
11:33:40  * joshonthewebquit (Quit: Computer has gone to sleep.)
11:36:29  * kievechuajoined
11:41:27  * dead_horsequit (Remote host closed the connection)
11:53:33  * joshonthewebjoined
12:06:10  * joshonthewebquit (Quit: Computer has gone to sleep.)
12:12:03  * bmacjoined
12:12:42  * LeXXikjoined
12:15:17  <LeXXik>raboid, I'm back
12:15:37  <raboid>here's how i set it up https://gist.github.com/raboid/13836ca44b38c3822b45
12:18:28  <raboid>it's essentially json rpc
12:20:34  <LeXXik>ok, I see
12:21:33  <LeXXik>how would you stack your middlewares?
12:21:49  <LeXXik>e.g. find user > create user
12:22:05  * raboidquit (Remote host closed the connection)
12:32:30  <mekwall>bleh, people always leave before I get the chance to respond :P
12:34:46  <LeXXik>mekwall, true that :)
12:42:27  * joshonthewebjoined
12:50:24  * raboidjoined
12:52:31  <raboid>LeXXik: Could you elaborate a bit more?
12:52:45  <raboid>very new to all this stuff
12:56:52  <LeXXik>raboid, well for example your client wants to create a new user
12:57:18  <mekwall>raboid: take a look at koan
12:58:21  <raboid>mekwall: for what?
12:58:31  <LeXXik>you need to first check if the request contains valid data, then you need to check if the user already exists, then you would save it to database
12:58:38  <mekwall>for an idea on how they solved the routing
12:59:01  <LeXXik>and if the user is also supplying an avatar, you'd need to add that extra step as well
12:59:15  <mekwall>or maybe not, they seem to only use websockets
12:59:33  <LeXXik>so you middleware becomes quite fat
13:01:03  <LeXXik>it's better to use a modular approach, so that these steps become independent from each other
13:01:38  <LeXXik>each step becomes a layer in your stack
13:02:07  <LeXXik>and as your request goes deeper into your stack, each layer could either pass it further or return with an error
13:03:04  <LeXXik>and as your requests returns, it would pass through the very first middleware on it's way back, where you could do the clean up and composition of the response
13:03:05  <raboid>LeXXik: yeah I can see having a request validator middleware before the router, but I think it'd be a bit silly to have a middleware just for checking if the User already exists, since this is just 1 line
13:04:02  <LeXXik>well, that was just an example, as your server grows, you will see what makes sense to separate
13:06:24  <raboid>LeXXik: yeah I think as I start to notice common patterns I will begin to modularize those into other middlewares.
13:06:57  <raboid>LeXXik: I also played around with the idea of bundling up all my functions into a single object so you can just do object[method](params) instead of the switch
13:08:31  * LeXXikquit (Ping timeout: 255 seconds)
13:09:31  <raboid>People were worried about security issues doing it that way, but I think if you just do a hasOwnProperty(method) check it should be fairly secure
13:14:51  * joshonthewebquit (Quit: Computer has gone to sleep.)
13:15:09  * ramitosquit (Ping timeout: 240 seconds)
13:15:10  * shesekquit (Ping timeout: 240 seconds)
13:15:18  * zumquit (Ping timeout: 245 seconds)
13:15:23  * shesekjoined
13:15:25  * zumjoined
13:16:15  * ramitosjoined
13:21:07  * joshonthewebjoined
13:40:01  * LeXXikjoined
13:55:22  * dead_horsejoined
14:12:25  * joshonthewebquit (Quit: Computer has gone to sleep.)
14:19:04  * kazuponjoined
14:23:58  * kazuponquit (Remote host closed the connection)
14:24:25  * kazuponjoined
14:28:56  * kazuponquit (Ping timeout: 255 seconds)
14:56:14  * JeremyWeijoined
14:57:01  * JeremyWeiquit (Client Quit)
14:59:31  * LeXXikquit (Quit: Leaving)
15:04:08  * bmacquit (Read error: Connection reset by peer)
15:04:16  * bmac_joined
15:04:40  * bmac_changed nick to Guest17682
15:20:12  * nam-shubquit
15:38:13  * raboidquit
15:39:03  * raboidjoined
15:40:13  * mekwallquit (Quit: ZNC - http://znc.in)
15:40:32  * oscargodsonjoined
15:40:50  * mekwalljoined
15:44:54  * oscargodsonquit (Ping timeout: 260 seconds)
15:53:45  <raboid>how could I use https://github.com/dcodeIO/bcrypt.js asynchronously with koa?
15:57:44  * Guest17682changed nick to bmac
15:58:15  <raboid>when I try to yield on the async functions I get that I'm passing undefined to yield
16:05:09  <hipsterslapfight>dont i use bcrypt-nodejs
16:05:48  <hipsterslapfight>raboid: and i use it something like this https://gist.github.com/hakoneko/ceff41f2fb9ba7321730
16:06:46  <hipsterslapfight>(with mongoose, but that should give you an idea anyway)
16:07:33  <raboid>okay i'll give bcrypt-nodejs a try, thanks
16:08:39  <hipsterslapfight>it looks like bcrypt.js will work too, obviously you cant use node.bcrypt because they don't support 0.11
16:12:21  <raboid>so it's really just a matter of wrapping it in thunkify?
16:12:34  <raboid>should I use node-thunkify or co-thunkify?
16:13:38  <hipsterslapfight>i just $ npm install thunkify
16:13:38  <hipsterslapfight>not sure which one that is :v
16:14:24  <raboid>alright cool I think that'll work
16:23:15  * kievechuaquit (Quit: kievechua)
16:30:34  * occultusjoined
16:49:47  * oscargodsonjoined
16:54:26  * oscargodsonquit (Ping timeout: 260 seconds)
16:58:26  * wilmoorejoined
17:04:27  * raboidquit (Remote host closed the connection)
17:05:16  * raboidjoined
17:09:22  * raboidquit (Ping timeout: 245 seconds)
17:14:39  * occultusquit (Ping timeout: 264 seconds)
17:38:37  * __quim_quit (Quit: Leaving...)
17:53:40  * dead_horsequit (Remote host closed the connection)
17:57:43  * occultusjoined
17:58:27  * raboidjoined
18:17:46  * TheAceOfHeartsjoined
18:24:11  * basicdaysjoined
18:26:32  * basicdays1joined
18:29:41  * basicdaysquit (Ping timeout: 272 seconds)
19:07:27  * occultus_joined
19:10:27  * occultusquit (Ping timeout: 264 seconds)
19:15:15  * occultus_quit (Ping timeout: 264 seconds)
19:17:43  * basicdays1quit (Quit: I'm out)
19:18:25  * occultusjoined
19:59:22  <raboid>how do you pass parameters into a generator?
20:01:17  <raboid>I'm calling a generator to parse my params from inside a generator that's handling the request. So I want to pass an array of valid params to that generator. It's a generator because I want it to be able to set the response status and body.. does this sound okay?
20:17:36  * __quimjoined
20:23:46  * ajk27quit (Remote host closed the connection)
20:23:46  * occultusquit (Remote host closed the connection)
20:23:53  <TheAceOfHearts>raboid: if it's a thunk you can just pass your params and then yield it; if you want it to have the same context you'll probably need to do something like myGenerator.call(this, params) I think
20:24:19  * ajk27joined
20:24:44  * occultusjoined
20:45:23  <raboid>Okay yeah I was wondering if I'd have to do that. only doing a app.use() creates that context automatically, correct?
20:47:05  * ramitosquit (Remote host closed the connection)
20:47:08  <TheAceOfHearts>app.use will set the context for you, yeah
20:47:16  <TheAceOfHearts>cuz it's a middleware raboid
20:47:24  * ramitosjoined
20:48:18  <raboid>fasho, thanks a lot.
20:51:19  <TheAceOfHearts>np
21:19:47  * boredzquit (Ping timeout: 264 seconds)
21:43:00  * raboidquit (Remote host closed the connection)
21:58:28  * occultus_joined
22:00:51  * occultusquit (Ping timeout: 264 seconds)
22:08:10  * LeXXikjoined
22:58:34  * LeXXikquit (Remote host closed the connection)
23:08:59  * wilmoorequit (Ping timeout: 272 seconds)
23:24:40  * bmacquit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:34:26  * __quimquit (Quit: Leaving...)