Middleware / API routes etc #98
Replies: 3 comments 3 replies
-
I'm pretty behind the first option still. Option 2 just feels like we'd be writing code, because we can? I think we need to list pros and cons for both approaches. Ultra for me has always been about streaming and rendering, nothing more nothing less. |
Beta Was this translation helpful? Give feedback.
-
There's definitely pros/cons to both. There was some reason originally that @mashaal dropped Oak (I can't recall why that was). Writing things ourselves has advantages if the server requirements for Ultra are fairly minimal and we don't require everything that Oak offers, we can eliminate a large dependency and have tighter control. |
Beta Was this translation helpful? Give feedback.
-
I think ideally we have something like:
Again, that is very 'Oak' like, but the reasons we moved around from Oak were that static files in Oak a bit of a black box, and at the time didn't work well with Deno Deploy (not sure they still do) oakserver/oak#416 (comment) ...and we ended up creating our own static file handler anyway. It just seemed like a bit overkill for a simple 'barebones' project. Deploying Ultra to various providers is still a priority, so we need to imagine how these changes will effect that. |
Beta Was this translation helpful? Give feedback.
-
So we probably have two options for middleware.
Recommend using the Oak server integration
src/oak/handler.ts
Write, borrow our own routing/middleware solution on top of
std/serve
Beta Was this translation helpful? Give feedback.
All reactions