Skip to main content

Rest Express

Github | npm

REST server for accounts-js

Install

yarn add @accounts/rest-express

Usage

import express from 'express';
import AccountsServer from '@accounts/server';
import accountsExpress from '@accounts/rest-express';

const accountsServer = new AccountsServer(...);

const app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use(accountsExpress(accountsServer));

app.listen(3000);

Options

const options = {
// Path that prefix the express routes for the accounts middleware
path: string,
};

app.use(accountsExpress(accountsServer, accountsExpressOptions));