cmorten / opine

Minimalist web framework for Deno ported from ExpressJS.
https://github.com/cmorten/opine/blob/main/.github/API/api.md
MIT License
854 stars 43 forks source link

Session middleware? #103

Closed devalexqt closed 3 years ago

devalexqt commented 3 years ago

How to use session middleware?

cmorten commented 3 years ago

Hi @devalexqt 👋

As far as I know there is currently no dedicated Deno session middleware for Opine.

If you’re interested in contributing to the Deno userland, this could perhaps be a good opportunity to do so!

This is a session module in the Deno registry (https://deno.land/x/session@1.1.0) but it currently only supports Oak and Attain servers, it doesn’t look like it would be much work to have it also support Opine.

An alternative is to see if you can use PIKA, JSPM or esm.sh to use an existing Express session middleware, converted to ESM. Once a module is ESM, using it as a middleware is the same as you would for Node Express.

cmorten commented 3 years ago

I have put in a PR to add Opine support to the session module, see https://github.com/denjucks/session/pull/15.

devalexqt commented 3 years ago

Thanks!

cmorten commented 3 years ago

This is an issue for the userland to solve rather than something in Opine itself, so closing for now. Shout if feel otherwise!