oakserver / oak

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
https://oakserver.org
MIT License
5.09k stars 231 forks source link

How to pass data to the frontend (Missing docs?) #615

Closed clorl closed 1 year ago

clorl commented 1 year ago

I'm looking for a "proper" way of sending backend data to frontend when serving the view. I know many templating engines do this, but is there a way to do it frontend-agnosticly?

Context.state seems to be for this exact purpose if I understand the docs correctly, but the doc doesn't go into how to retrieve this data on the frontend.