login_signup

login_signup loopback4

Usage no npm install needed!

<script type="module">
  import loginSignup from 'https://cdn.skypack.dev/login_signup';
</script>

README

Login Signup loopback4

The login_signup module is a Node.js based loopback script and it provides a fastest way to create user signup and login services.

Pre-requisites

Node.js , and the platform-specific tools needed to compile native NPM modules (which you may already have):

Installation

To install the login_signup_node module, simply run the following command within your app's directory:

npm install  login_signup --save

Development

var app = require("login_signup");

Database Configuration:

const databaseconfig = {
    name: 'user',
    connector: 'mongodb',
    url: '',
    host: 'localhost',
    port: 27017,
    user: '',
    password: '',
    database: 'getoverit',
};

app.dbconfig.setDataSource(databaseconfig);
Note: email, username and password in schema are must. but you can declare any number of fields you can. id feild is generated by default for every signup.

Must follow below model properties configuration for payment integration with Authorize.net

Model Configuration:

const schema = {
    properties: [
        { type: 'string', required: false, name: 'email' },
        { type: 'string', required: false, name: 'password' },
        { type: 'string', required: false, name: 'username' },
        { type: 'number', required: false, name: 'phone' },
    ],
};
app.generateModel.generate(schema);

Include following to start app:

app.startServer();

Run following in your terminal to start the APP:

 node script.js

Verify the deployment by navigating to your server address in your preferred browser.

http://localhost:8080/ping

Example for signup

http://localhost:8080/users/signup

     {
     "email":"wagaf",
      "password":"swarup123s4",
      "username":"swarup",
      "phone":"8977924082"
      }

Example for login

http://localhost:8080/users/login
{
     "email":"wagaf",
      "password":"swarup123s4"
      }

Licence

MIT