relinker
v1.0.0
Published
Designated server linker api
Downloads
2
Readme
a Designated application website linker to link data within a website.
About relinker
Relinker is designed to make linking to a website simple by not making the programmer type a lot of code.
It's a simple way to link between something and something.
Usage and examples
npm install relinker
This will install relinker to the current project.
After the installation is done you may follow the examples below:
- Relinker Server:
const Relinker = require("relinker"); // Require the package
const Server = Relinker.createRelinkerServer(8080, {
path: "/api/link"
}); // Linker Server, Port is 8080 and the linker path is "/api/link"
Server.listen(); // Make the relinker start listening to the server.
- Relinker Client:
const Relinker = require("relinker");
const Client = Relinker.createRelinkerClient("/api/link"); // Create a client, url is /api/link as what we sat above.
// Generate a code
const data = await Client.generateAuthenticationCode() // Returns AuthenticationData Class
// Validating code. There are two ways
/// AuthenticationData class way:
const data = await Client.generateAuthenticationCode() // Returns AuthenticationData Class
const accepted = await Client.validate(data); // Validates and returns true or false
/// Code way
const accepted = await Client.validateCode("6c4412135279d15ba0ec9751d82aa211") // random code, returns true or false
License
Open sourced and licensed under MIT license. Made by Max Jackson and MBP with <3