Hello community!
Probably this question has already been answered here. I’ve also found similar questions (How to design app with JSON API and HTML interface?), but I don’t feel like I completely understand it.
I want to create a Phoenix app which has a JSON API and HTML interface. I wonder what’s a clean structure for my Phoenix app.
-
lib/example
: In here is my domain and shared stuff like models and other things. -
lib/example_web
: Here the HTML interface lives. -
lib/example_api
: That’s where my API interface lives.
Currently I have a router.ex
in my lib/example_web
. Should I pull this into lib/example
?
Thank you in advance!
Robin