0.1.0 • Published 7 years ago

express-slack-postgres-store v0.1.0

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

Slack Express Postgres Store

This is a super simple store implementation for express-slack.

Install

npm install --save express-slack-postgres-store

Create store database table

The database table used by the store module must be created. Example creating a database table named store:

CREATE TABLE IF NOT EXISTS store (
  id char(50) NOT NULL PRIMARY KEY,
  data jsonb
);

Usage

const dataStore = require("express-slack-postgres-store")({
  database: process.env.DATABASE_URL + "?ssl=true",
  table: "store"
});
ArgumentDescription
databasePostgres connection string
tableDatabase table name for data store

Now use the initialized variable as a data store when configuring express-slack:

app.use('/slack', slack({
  scope: SCOPE,
  token: TOKEN,
  store: dataStore
  client_id: CLIENT_ID,
  client_secret: CLIENT_SECRET
}));