Giter VIP home page Giter VIP logo

yup_docs's People

Contributors

andrei0x309 avatar dependabot[bot] avatar erichgorski avatar noahj867 avatar pinkhoodie avatar vernonjohnson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yup_docs's Issues

How to deploy?

I am looking at deploying the docs locally and I can't figure out how to deploy the gitbook.

Whenever I try an npm install I get an error about EINTEGRITY:

npm ERR! code EINTEGRITY
npm ERR! sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== integrity checksum failed when using sha512: wanted sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== but got sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==. (2962 bytes)

I then deleted the package-lock.json file and tried again and ran into another issue:

> [email protected] build /redacted/yup_docs
> rollup -c


/redacted/yup_docs/src/js/index.js โ†’ dist/docsify-tabs.js...
[!] (eslint plugin) Error: No ESLint configuration found.
src/js/index.js
Error: No ESLint configuration found.

Is this hosted on the gitkeep cloud instead and cannot be deployed locally?

API Endpoint Documentation

Is the documentation on this webpage accurate?

I am trying to utilize the API as indicated and I am continually receiving errors for most endpoints. Notably, I am receiving 404 errors for all, suggesting the page doesn't exist. As far as I can tell, I am building the URLs correctly.

See test code below.

# ----------------
# ----------------
# FUNCTIONS
# ----------------
# ----------------

def get_post_data(base_url, endpoint, post_id):
    """
    Send a GET request to the specified post endpoint for the given post ID.

    Args:
    base_url (str): The base URL of the API.
    endpoint (str): The endpoint to which the GET request is sent.
    post_id (str): The post ID to retrieve.

    Returns:
    dict: The response data received from the API in JSON format.
    """
    # Construct the full URL
    url = f"{base_url}{endpoint}{post_id}"
    print("Hitting following URL:", url)

    # Send the GET request
    response = requests.get(url)

    # Check if the request was successful
    if response.status_code == 200:
        return response.json()  # Return the JSON response
    else:
        return {"error": f"Failed to retrieve data, status code: {response.status_code}"}
    
    
def get_user_data(base_url, endpoint, username):
    """
    Send a GET request to the specified post endpoint for the given post ID.

    Args:
    base_url (str): The base URL of the API.
    endpoint (str): The endpoint to which the GET request is sent.
    post_id (str): The post ID to retrieve.

    Returns:
    dict: The response data received from the API in JSON format.
    """
    # Construct the full URL
    if endpoint == "levels":
        url = f"{base_url}{endpoint}"
    else:
        url = f"{base_url}{endpoint}{username}"
    print("Hitting following URL:", url)

    # Send the GET request
    response = requests.get(url)

    # Check if the request was successful
    if response.status_code == 200:
        return response.json()  # Return the JSON response
    else:
        return {"error": f"Failed to retrieve data, status code: {response.status_code}"}

    
# ----------------
# ----------------
# TESTING ENDPOINTS
# ----------------
# ----------------
    
    
base_url = "http://api.yup.io/"

my_username = "mrd"
my_post_id = "03925e2a-a3bb-4710-b3ce-331cd96bd2c1"


posts_endpoints = [
    "posts/post/",
    "comments/post/",
    "posts/interactions/",
]
users_endpoints = [
    "levels",
    "levels/users/",
    "accounts/",
    "followers/",
    "following/",
]

print("GET POSTS")
for endpoint in posts_endpoints:
    data = get_post_data(base_url, endpoint, my_post_id)
    if "error" not in data:
        print("\t- Successful retrieval.")
        continue
        
    print("\t- ",data)
    
print("\n\n")
print("GET USERS")
for endpoint in users_endpoints:
    data = get_user_data(base_url, endpoint, my_username)
    if "error" not in data:
        print("\t- Successful retrieval.")
        continue
        
    print("\t- ",data)

This outputs the below

GET POSTS
Hitting following URL: http://api.yup.io/posts/post/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
	- Successful retrieval.
Hitting following URL: http://api.yup.io/comments/post/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
	-  {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/posts/interactions/03925e2a-a3bb-4710-b3ce-331cd96bd2c1
	-  {'error': 'Failed to retrieve data, status code: 404'}


GET USERS
Hitting following URL: http://api.yup.io/levels
	-  {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/levels/users/mrd
	-  {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/accounts/mrd
	- Successful retrieval.
Hitting following URL: http://api.yup.io/followers/mrd
	-  {'error': 'Failed to retrieve data, status code: 404'}
Hitting following URL: http://api.yup.io/following/mrd
	-  {'error': 'Failed to retrieve data, status code: 404'}

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.