I'm a bit new to this. I want to develop a web application and my question is should I build a seperate REST backend using the play framework and a frontend that calls the backend trough AJAX.
Or maybe I should build a REST application that serves the frontend views when asked for HTML but when asked for the JSON type serves the JSON data (if an auth token is present).
I'm wondering what the best practices are ?
EDIT:
The reason I want a REST backend is to support possible future standalone mobile apps and maybe even third-party apps.
No best answer here, it really depends on your project. Play allows you to do both anyway.
Cases where you'd better go with plain HTML:
Cases where it's better to choose "one page app":
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With