1.0.5 • Published 2 years ago

connect-deta v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Connect Deta

Use Deta Base to store cookie sessions, compatiable with Express Session.

How to install:

npm install deta express express-session 
npm install connect-deta

How to use:

var express = require("express");
var session = require("express-session");
var DetaBaseStore = require("connect-deta")(session);

var app = express();

app.use(
  session({
    store: new DetaBaseStore({
      detaProjectKey: "", // your deta base project id
      detaBaseName: "session", // optional table name, defaults to "session"
      prefix: "test:", // optional prefix for session id
    }),
    secret: "keyboard cat",
    resave: false,
    saveUninitialized: true,
    cookie: {
      maxAge: 60 * 10000, // this will set the expiresAt field in Deta base
    },
  })
);

MIT Open Source

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago