The backend is so far just quickly glued together, in order to be runnable. So everything is subject to be changed/modernized by you.
Under src/leihs/inventory there are separate paths and thus namespaces for backend (CLJ), frontend (CLJS) and common (CLJC). This folder structure might be subject of discussion, however it should be good to start. (It is quite easy to do a namespace refactoring later, at least with VS Code...).
I have created a simple mini frontend with plain CLJS which has Reitit as router. (This will be substituted by the new stack from @belafonte later).
The routes are defined in leihs.inventory.common.routes, shared for backend and frontend, in a format compatible with Reitit. There is a adapter function in leihs.inventory.backend.paths which converts the data to the format required by bidi. This can be removed of course as soon as the backend works with Reitit.
Please also substitute the Ring configuration in leihs.inventory.backend.routes with what is wanted from a backend perspective. Probably Madek Auth is the role model. My implementation has the following problems:
Returns Status 200 also for paths not defined in routes.cljc
When a backend handler is defined (like for api-models-index), it is invoked even when the request says "Accept: text/html" (actually it should return leihs.inventory.backend.html/html-handler in this case)
Infos for @SeduroDotCom :
The backend is so far just quickly glued together, in order to be runnable. So everything is subject to be changed/modernized by you.
Under
src/leihs/inventory
there are separate paths and thus namespaces for backend (CLJ), frontend (CLJS) and common (CLJC). This folder structure might be subject of discussion, however it should be good to start. (It is quite easy to do a namespace refactoring later, at least with VS Code...).I have created a simple mini frontend with plain CLJS which has Reitit as router. (This will be substituted by the new stack from @belafonte later).
The routes are defined in
leihs.inventory.common.routes
, shared for backend and frontend, in a format compatible with Reitit. There is a adapter function inleihs.inventory.backend.paths
which converts the data to the format required bybidi
. This can be removed of course as soon as the backend works with Reitit.Please also substitute the Ring configuration in
leihs.inventory.backend.routes
with what is wanted from a backend perspective. Probably Madek Auth is the role model. My implementation has the following problems:routes.cljc
api-models-index
), it is invoked even when the request says "Accept: text/html" (actually it should returnleihs.inventory.backend.html/html-handler
in this case)