@@ -4,6 +4,9 @@ Complete, compliant and well tested module for implementing an OAuth2 Server/Pro
44
55[ ![ Tests] ( https://github.com/node-oauth/express-oauth-server/actions/workflows/tests.yml/badge.svg )] ( https://github.com/node-oauth/express-oauth-server/actions/workflows/tests.yml )
66[ ![ CodeQL] ( https://github.com/node-oauth/express-oauth-server/actions/workflows/github-code-scanning/codeql/badge.svg )] ( https://github.com/node-oauth/express-oauth-server/actions/workflows/github-code-scanning/codeql )
7+ [ ![ Project Status: Active – The project has reached a stable, usable state and is being actively developed.] ( https://www.repostatus.org/badges/latest/active.svg )] ( https://www.repostatus.org/#active )
8+ [ ![ npm Version] ( https://img.shields.io/npm/v/@node-oauth/express-oauth-server?label=version )] ( https://www.npmjs.com/package/@node-oauth/oauth2-server )
9+ [ ![ npm Downloads/Week] ( https://img.shields.io/npm/dw/@node-oauth/express-oauth-server )] ( https://www.npmjs.com/package/@node-oauth/oauth2-server )
710![ GitHub] ( https://img.shields.io/github/license/node-oauth/express-oauth-server )
811
912
@@ -24,11 +27,11 @@ expect the request body to be parsed already.
2427The following example uses ` body-parser ` but you may opt for an alternative library.
2528
2629``` js
27- var bodyParser = require (' body-parser' );
28- var express = require (' express' );
29- var OAuthServer = require (' @node-oauth/express-oauth-server' );
30+ const bodyParser = require (' body-parser' );
31+ const express = require (' express' );
32+ const OAuthServer = require (' @node-oauth/express-oauth-server' );
3033
31- var app = express ();
34+ const app = express ();
3235
3336app .oauth = new OAuthServer ({
3437 model: {}, // See https://github.com/node-oauth/node-oauth2-server for specification
@@ -45,21 +48,31 @@ app.use(function(req, res) {
4548app .listen (3000 );
4649```
4750
51+ ## More Examples
52+
53+ For more examples, please visit [ our dedicated "examples" repo] ( https://github.com/node-oauth/node-oauth2-server-examples )
54+ , which also contains express examples.
55+
4856## Options
4957
58+ > Note: The following options ** extend** the default options from ` @node-oauth/oauth2-sever ` !
59+ > You can read more about all possible options in the
60+ > [ @node-oauth/oauth2-sever documentation] ( https://node-oauthoauth2-server.readthedocs.io/en/master/api/oauth2-server.html )
61+
5062```
51- var options = {
63+ const options = {
5264 useErrorHandler: false,
5365 continueMiddleware: false,
5466}
5567```
56- * ` useErrorHandler `
68+
69+ - ` useErrorHandler `
5770(_ type: boolean_ default: false)
5871
5972 If false, an error response will be rendered by this component.
6073 Set this value to true to allow your own express error handler to handle the error.
6174
62- * ` continueMiddleware `
75+ - ` continueMiddleware `
6376(_ type: boolean default: false_ )
6477
6578 The ` authorize() ` and ` token() ` middlewares will both render their
@@ -69,3 +82,7 @@ var options = {
6982 ** Note:** You cannot modify the response since the headers have already been sent.
7083
7184 ` authenticate() ` does not modify the response and will always call next()
85+
86+ ## License
87+
88+ MIT, see
0 commit comments