0.0.25 • Published 9 years ago

membership-mysql-store v0.0.25

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

membership-mysql-store

A MySQL store for membership.js

Installation

Add to your application via npm:

npm install membership-mysql-store --save

This will install membership-mysql-store and add it to your application's package.json file.

How to Use

Use with your express session middleware, like this:

var MysqlMembershipStore = require("membership-mysql-store");

var options = {
	host: 'localhost',
	port: 3306,
	user: 'session_test',
	password: 'password',
	database: 'session_test',
	syncDB: false
};

var mysqlMembershipStore = new MysqlMembershipStore(options);

mysqlMembershipStore.createUser({
	email: "mail@example.com"
}, "hashedpassword").then(function(user){
	console.log(user);
}).catch(function(error){
	console.error(error);
});

Debugging

express-mysql-session uses the debug module to output debug messages to the console. To output all debug messages, run your node app with the DEBUG environment variable:

DEBUG=express-mysql-session* node your-app.js

This will output log messages as well as error messages from express-mysql-session.

If you also might need MySQL-related debug and error messages, include mysql-connection-manager as well:

DEBUG=express-mysql-session*,mysql-connection-manager node your-app.js

Configure Local Environment

Step 1: Get the Code

First, you'll need to pull down the code from GitHub:

git clone https://github.com/ErezAlster/membership-mysql-store.git

Step 2: Install Dependencies

Second, you'll need to install the project dependencies as well as the dev dependencies. To do this, simply run the following from the directory you created in step 1:

npm install

Step 3: Set Up the Test Database

Now, you'll need to set up a local test database:

{
	host: 'localhost',
	port: 3306,
	user: 'session_test',
	password: 'password',
	database: 'session_test',
	syncDB: true
}

The test database settings are located in test/config.json

Running Tests

With your local environment configured, running tests is as simple as:

npm test
0.0.25

9 years ago

0.0.24

9 years ago

0.0.23

9 years ago

0.0.22

9 years ago

0.0.21

9 years ago

0.0.20

9 years ago

0.0.19

9 years ago

0.0.18

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

1.0.0

10 years ago