Replies: 2 comments 1 reply
-
IMO you may be better just writing an adapter that will handle the marshalling based on the http header, and use it to decorate the response that the endpoints already return. You might even be able to add it to the hooks function rather than in each endpoint. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I was meaning "adapter" as in classic ports-and-adapters architecture, completely forgetting that Svelte uses the term :) (although a similar concept / reason). Basically, imagine having a function that you pass the request and response to, that your endpoint has already created as an object. This function could The |
Beta Was this translation helpful? Give feedback.
-
Is it possible to map request according to their
accept
header to svelte routes?application/xml
routes/index.xml.js
text/xml
routes/index.xml.js
application/vnd.siren+json
routes/index.json.js
Beta Was this translation helpful? Give feedback.
All reactions