Skip to content

Functionaly Complete

Pre-release
Pre-release

Choose a tag to compare

@Notliam99 Notliam99 released this 29 Dec 01:40
· 9 commits to main since this release
664f4ab

Next Steps

Need to add developer documentation

How To Use

Some sample code for the API very basic but gives you an understanding of how it works.

./main.py

from piApi import Api


api = Api()


@api.get('/')
def hello_world(request):
    """
        Index route decorated by @api.get()
        ARGS:
            request: dict # contains the parsed request
        RETURNS:
            document: str
            responce_code: int # optional
            custom_headers: dict # optional Requries( responce_code )
    """
    doc = f'''
        <center>
            <h1>Hello World<h1>
            <hr>
            <p>{request}</p>
        </center>
    '''
    return doc, 200


def Main():
    api.run(80)


if __name__ == '__main__':
    Main()