Coder Social home page Coder Social logo

connect-parse's Introduction

#connect-parse

This is a simple session store for connect using Parse.

It uses the parse npm module, which you are probably using already as a data storage for your project.

Installation

$ npm install connect-parse

Options

A Parse client is required. An existing client can be passed directly using the client option or created for you using parseAppId and parseJavascriptKey options.

  • client An existing, initialised Parse client created using parse npm module;
  • parseAppId, parseJavascriptKey your Parse Application ID and JavaScript key. Could be omitted if initialised Parse client is passed via client option;

The following additional params may be included:

  • ttl Session TTL (Time to live) expiration in seconds. Defaults to cookie.maxAge if set, or to 86400 seconds (1 day);
  • parseClassName Class name to store sessions in Parse. Defaults to Session.

Usage

We pass express-session to required connect-parse module exports in order to extend default connect session.Store:

var session = require('express-session');
var ParseStore = require('connect-parse')(session);

var Parse = require('parse').Parse;
Parse.initialize('PARSE_APPLICATION_ID', 'PARSE_JAVASCRIPT_KEY');

app.use(session({
  secret: process.env.SESSION_SECRET,
  store: new ParseStore({
    client: Parse
  }),
  resave: true,
  saveUninitialized: true
}));

connect-parse's People

Watchers

Sergey Tkachenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.