Code Monkey home page Code Monkey logo

oauth2's Introduction

oauth2-nodejs-sample

standard-readme compliant

δΈ­ζ–‡

Background

Using the example made by koa2 and oauth2, the project uses mongodb and redis for data management, in which mongodb performs data query, and redis manages the token in oauth2;

Installation

This project uses node and npm. Please make sure you install them locally -Use npm

$ npm i

-Or yarn, of course tyarn is recommended for inland China

$ npm install yarn -g
$ yarn

How to run

Run

$ yarn run start

Pack and run

$ yarn run prod # Need to install pm2

-Access in browser

http://localhost:7001

Project structure

|-- .eslintignore
|-- .eslintrc
|-- .gitignore
|-- app.js
|-- package.json
|-- readme-zh.md
|-- readme.md
|-- bin
| |-- www
|-- public
|-- src
| |-- config
| | |-- index.js
| |-- mongoose
| | |-- index.js
| | |-- models
| | |-- clientModel.js
| | |-- userModel.js
| |-- oauth
| | |-- compatibleTokenError.js
| | |-- errorCode.js
| | |-- index.js
| | |-- model.js
| |-- redis
| | |-- index.js
| |-- routes
| | |-- index.js
| | |-- router.spec.js
| |-- utils
| |-- errorHandle.js
| |-- httpException.js
| |-- log4j.js
| |-- res.js
| |-- tool.js
| |-- tool.spec.js
|-- test
    |-- restClient.http

Structure description

  • config: configuration file, please refer to ioredis, log4js, mongoosejs
  • mongoose: Process all operations of mongoose
  • oauth: handle oauth2 authentication, currently supported modes are: password and refresh_token
  • redis: Process redis requests
  • routes: Process routing
  • util: all tools
  • test/restClient.http: simple request example

Maintainer

@yy921010

How to contribute

You are very welcome to join! Mention a Issue or submit a Pull Request. The standard Readme follows the Contributor Covenant code of conduct.

License

MIT @yy921010

oauth2's People

Contributors

yy921010 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.