Skip to content

Instantly share code, notes, and snippets.

@RussellJapheth
Created November 10, 2022 10:28
Show Gist options
  • Save RussellJapheth/11f12957a67573e367afccad624ae993 to your computer and use it in GitHub Desktop.
Save RussellJapheth/11f12957a67573e367afccad624ae993 to your computer and use it in GitHub Desktop.

Prybar Api Reference

v1.0.0rfc

Users

Login

Login in to the application

${BASE_URL}/auth/login

(async () => {
    let data = {
        email, // The user's email
        password, // The users password
    };

    let res = await fetch(`${BASE_URL}/auth/login`, {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify(data),
    });
    res = await res.json();
    // return res;
})();

Register

Register a new user

${BASE_URL}/auth/register

(async () => {
    let data = {
        username, // The user's name
        email, // The user's email
        password, // The users password
    };

    let res = await fetch(`${BASE_URL}/auth/register`, {
        method: "POST",
        headers: {
            "Content-Type": "application/json",
        },
        body: JSON.stringify(data),
    });
    res = await res.json();
    // return res;
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment