0.0.4 • Published 3 years ago

express-oracle-session-ts v0.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

Install

npm install express-oracle-session-ts

Usage

import express from "express";
import eos from "express-oracle-session-ts";
import session from "express-session";

const OracleSessionStore = eos(session);

const sessionStore = new OracleSessionStore({
  user: ORACLE.user,
  password: ORACLE.password,
  connectionString: ORACLE.conStr,
  schema: {
    tableName: "tbl_cloud_session",
  },
});

// Create Express server
const app = express();

app.use(
  session({
    resave: true,
    saveUninitialized: true,
    secret: SESSION_SECRET,
    store: sessionStore,
  })
);

Notes

  • this module was largely a port of express-oracle-session to typescript because at that time express-oracle-session failed to work with node oracle 5. But it seems that it has been updated recently probably to address this issue.
  • works with lastest node oracle (5+).
  • will create new table if the current session table doesn't not exist.
  • querying oracle DB, if failed, this module will retry three times. If it can't get the connection it will throw an error and exit the app (process.exit(1)).