yonahforst / my_enginified_app

2 stars 0 forks source link

Using the API Engine internally #1

Open sevfurneaux opened 10 years ago

sevfurneaux commented 10 years ago

Great to see an example of the API And Frontend Engines.

Would you use the API Engine internally? So it would return json in the Frontend Engine? Would love to know how you would see this working in the Frontend controllers.

yonahforst commented 10 years ago

Hi @sevfurneaux. Thanks! I'm glad you like it.

I'm not sure if I understand the question, but I only use the API in the frontend to answer JS requests from the browser, using something like Angular or Ember.

sevfurneaux commented 10 years ago

Ah that makes sense! I was curious to know if you returned JSON from the API Engine in the Frontend Engine's views (i.e not Angular or Ember)

yonahforst commented 10 years ago

:) no not really. I would only return json from the API

sevfurneaux commented 10 years ago

What I mean is, you don't use the models directly in the Frontend Engine controllers. You use the API Engine's json to render the Frontend Engine's views. Does that make sense?

yonahforst commented 10 years ago

ah ok. Well you could do it either way. Load the data from the frontend controller and render it in the view, or load it afterwards as JSON from the API