Firefox Accounts DB Server
For context, see the
fxa-auth-db-mysql
repo,
which contains a MySQL backend
(for production)
and a memory-store backend
(for testing).
This package
is actually a sub-directory
of that repository.
Usage
var dbServer = require('fxa-auth-db-server')
var Store = require('./db.js')
var db = new Store(console, dbServer.errors)
var server = dbServer.createServer(db)
server.listen(8080, 'localhost', function() {
console.log('Server is listening')
})
server.on('error', function (err) {
console.error('Error when starting the server:', err)
})
server.on(
'success',
function (data) {
console.log('+ %s %s took %dms', data.method, data.url, data.t)
}
)
server.on(
'failure',
function (data) {
console.warn('- %s %s failed with %d', data.method, data.url, data.err.code)
}
)
server.on(
'mem',
function (stats) {
console.log('Memory stats:', stats)
}
)
DB API
If you would like to implement a
database/storage API, this document will be
useful.
Server API
If you want to know more
about the endpoints
implemented by this server,
read the
server API documentation.
License
MPL 2.0