These are chat archives for wheres-my-receipt/give_me_your_money

30th
Mar 2015
Sarah Johnston
@sarahabimay
Mar 30 2015 11:09
Thanks James. I don't see the changes to Readme so I guess you didn't do the final push last night? Can you do this and then I'll carry on.. Anything you were thinking about project let me know as I'm going to keep working on it slowly this week.
also, can you add me to the repo for the playabl project this week and keep me in the loop on the gitter? thanks!
James Griffiths
@MIJOTHY
Mar 30 2015 12:19
sure my changes are on my branch
having a problem with testing session handlers as it thinks there is no active session to set - will look at it later tonight
wrt playa, it's very much conceptual at the moment, will add you to repo when we've made one
Sarah Johnston
@sarahabimay
Mar 30 2015 14:15
thanks james. let me know when you've made a pull request.
James Griffiths
@MIJOTHY
Mar 30 2015 15:06
ok, when i get time im gonna refactor all the handlers
so we have a distinct api layer and a distinct views layer
they got kinda jumbled towards later in the week
Sarah Johnston
@sarahabimay
Mar 30 2015 15:07
i'll look into it! I'm sure you're going to be busy!
James Griffiths
@MIJOTHY
Mar 30 2015 15:07
after a chat with will, he mentioned that can use server.inject for that, which is really useful and apparently what it is meant for (as well as testing) according to the hapi docs
so like request to /account (view) route -> view handler -> server.inject to /accounts/user route -> in callback reply with view
Sarah Johnston
@sarahabimay
Mar 30 2015 15:08
use server inject for what (other than testing, I'm not sure what you mean)
James Griffiths
@MIJOTHY
Mar 30 2015 15:09
server.inject just simulates a request to a server without the network layer, so we can use it in our actual code to access our own api without needing to send other requests
and that way we keep the view logic entirely seperate from the api logic
Adam Kowalczyk
@adamkowalczyk
Mar 30 2015 15:09
oooh
James Griffiths
@MIJOTHY
Mar 30 2015 15:09
so someone, if they wanted to, could build an app entirely around our api
and not touch/have to navigate around the view routes
Sarah Johnston
@sarahabimay
Mar 30 2015 15:10
ahhh ok.. I'm almost with you.. will do some research
James Griffiths
@MIJOTHY
Mar 30 2015 19:36
it'll take a hell of a lot of refactoring but here's a basic description of what might happen
request to /account (view route) --> goes to account view handler, where some preparatory work is done (setting variables based on the request object or somesuch) --> create an 'options' object with a url of '/api/accounts/'+req.auth.credentials.username --> inject it into our server --> in response callback, reply with rendered view or w/e
Sarah Johnston
@sarahabimay
Mar 30 2015 21:07
yep I did a little research earlier. A good idea and great it didn't get past us!