1.1.4 • Published 7 years ago

sf_auth_server v1.1.4

Weekly downloads
6
License
ISC
Repository
-
Last release
7 years ago

sf_auth_server

Install

Install with Npm

$ npm install sf_auth_server

Versions

Current Version

1.1.4

Usage

Import pakage

var Express = require('express');
var app = Express();
var Auth require('sf_auth_server');
var config_db= {
	username: 'localhost',
    password: '****',
    database: 'authentication',
    host: '0.0.0.0',
    dialect: 'mysql',
    define: {
        timestamps: false
    },
    logging: false
};
var table_db = "autho_user"; //Table's name 
var au = new Auth(app,config_db,table_db);

Feature in this version

Create two api for authentication

  • 'Login'
	POST: '/api/login'
  • 'Signup'
	POST: '/api/signup'

Note: service'll return a object: result = { isSuccess, token, type }

  • 'GetProfile'
	GET: '/api/getProfileByToken'

Note: service'll return a object: result = { isSuccess, id, username }