0.1.6 • Published 11 years ago

userific-server v0.1.6

Weekly downloads
3
License
-
Repository
github
Last release
11 years ago

Userfic Server

A restful api server to manage users in your application. The server can be used with any userfic backends.

Installation

npm install -S userific-server

Setup

To setup the server you need to supply a properly configured userific backend

var userificServer = require('userific-server')
var mongooseBackend = require('userific-mongoose')
var config = {
    database: 'fooDatabase',
    username: 'fooUsername',
    password: 'fooPassword'
}

// instatiate a mongoose userific backend which stores user data in a MongoDB database
var backend = mongooseBackend(config)

// pass the backend in as a parameter. Note that server here is an instance of restify.createServer
var server = userificServer(backend, serverConfig)
// start the server on port 3000
var port = 3000
server.listen(3000)

When creating the server in the example above, serverConfig is the configuration object that is passed to restify.createServer. Restify Documentation. For example if you wish to create an https server, pass the certificate and key objects

var userificServer = require('userific-server')
var backend = {} //some instatiated userific backend
var serverConfig = {
    certificate: 'PEM-encoded certificate string here',
    key: 'PEM-encoded key string here'
}

var server = userificServer(backend, serverConfig)

Routes

For example say the server is listening on host: localhost, port: 3000 and is configured to use https. Once the server is setup and listening on port 3000 the following routes are available.

  • https://localhost:3000/register
  • https://localhost:3000/authenticate
  • https://localhost:3000/changeEmail
  • https://localhost:3000/changePassword

Register

To register a new user

0.1.6

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago