Giter Site home page Giter Site logo

token_based_auth's Introduction

Project Information

Simple token based authorization project

Description

Signup, Login, Logout (users/logout API) features implemented. Is saves token in cookie and uses for future requests.

How to install?

  • In order to install dependencies just execute following command:
npm install
  • In order to run server locally run following command:
DEBUG=myapp:* npm start

Sequelize ORM Integration

  1. Clone in Desktop // Install Sequelize ORM $npm install --save sequelize // Install Sequelize Command Line Interface(CLI) Tool $npm install --save sequelize-cli // Initialize Sequlize ORM in order to generate ORM files $sequelize init // result Sequelize [Node: 4.2.6, CLI: 2.7.0, ORM: 4.0.0]

Created "config/config.json" Successfully created migrations folder at "/data/projects/nodejs/exam/migrations". Successfully created seeders folder at "/data/projects/nodejs/exam/seeders". Successfully created models folder at "/data/projects/nodejs/exam/models". Initialize migrations, this command creates : model, migrations, seeds, config.json

// Create a sequelize config file $sequelize init Create simple User model // user model $sequelize model:create --force --name Users --attributes "username:string, password:string, first_name:string, last_name:string, birth_date:Date, email:string, token:string, pid:string, type:string"

DB model migration. $sequelize db:migrate

Application migration setting in config.json add following line: "use_env_variable": "DATABASE_URL" for heroku PostgreSQL use environment setting value: var sequelize = new Sequelize(process.env.DATABASE_URL);

// After login chat page test method: POST URL: http://localhost:3000/chat Header: add Authorization and add JWT + token

token_based_auth's People

Watchers

James Cloos avatar Mashhur 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.