0.0.25 • Published 7 years ago

membership-mysql-store v0.0.25

Weekly downloads
2
License
MIT
Repository
github
Last release
7 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

7 years ago

0.0.24

7 years ago

0.0.23

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

8 years ago

0.0.18

8 years ago

0.0.17

8 years ago

0.0.16

8 years ago

0.0.15

8 years ago

0.0.14

8 years ago

0.0.13

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago

1.0.0

8 years ago