Skip to main content

A simple web framework for aws lambda

Project description

WellAPI

WellAPI is a simple web framework for work with AWS Lambda and API Gateway. It is designed to be easy to use and flexible, allowing you to create RESTful APIs quickly and efficiently.

Features

  • Simple and intuitive API for defining routes and handling requests
  • Support for middleware functions
  • Automatic request validation and error handling
  • Support for CORS
  • Support for query parameters, path parameters, and request bodies
  • Support for error handling
  • Support for AWS Lambda and API Gateway

Installation

You can install WellAPI using pip:

pip instsll wellapi

Example

from wellapi import WellApi

app = WellApi()

@app.get("/hello")
def hello():
    return {"message": "Hello, World!"}

Local development

You can run your WellAPI application locally using the wellapi command:

wellapi run main:app

Deploy

from wellapi.build.cdk import WellApiCDK


class MyStack(Stack):
    def __init__(self, scope: Construct, id_: str, **kwargs) -> None:
        super().__init__(scope, id_, **kwargs)

        app = WellApiCDK(
            self,
            "WellApiCDK",
            app_srt="main:app",
            handlers_dir="handlers",
        )

CORS

You can enable CORS for your API by setting the cors parameter to True when creating the WellApiCDK instance:

from wellapi.build.cdk import WellApiCDK


class MyStack(Stack):
    def __init__(self, scope: Construct, id_: str, **kwargs) -> None:
        super().__init__(scope, id_, **kwargs)

        app = WellApiCDK(
            self,
            "WellApiCDK",
            app_srt="main:app",
            handlers_dir="handlers",
            cors=True,
        )

Cache

You can enable caching for your API by setting the cache_enable parameter to True when creating the WellApiCDK instance:

from wellapi.build.cdk import WellApiCDK


class MyStack(Stack):
    def __init__(self, scope: Construct, id_: str, **kwargs) -> None:
        super().__init__(scope, id_, **kwargs)

        app = WellApiCDK(
            self,
            "WellApiCDK",
            app_srt="main:app",
            handlers_dir="handlers",
            cache_enable=True,
        )

!!! WARNING !!!

Caching support only GET endpoints

Logging

You can enable logging for your API by setting the log_enable parameter to True when creating the WellApiCDK instance:

from wellapi.build.cdk import WellApiCDK


class MyStack(Stack):
    def __init__(self, scope: Construct, id_: str, **kwargs) -> None:
        super().__init__(scope, id_, **kwargs)

        app = WellApiCDK(
            self,
            "WellApiCDK",
            app_srt="main:app",
            handlers_dir="handlers",
            log_enable=True,
        )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wellapi-0.4.6.tar.gz (55.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wellapi-0.4.6-py3-none-any.whl (54.2 kB view details)

Uploaded Python 3

File details

Details for the file wellapi-0.4.6.tar.gz.

File metadata

  • Download URL: wellapi-0.4.6.tar.gz
  • Upload date:
  • Size: 55.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.14

File hashes

Hashes for wellapi-0.4.6.tar.gz
Algorithm Hash digest
SHA256 992e162bb7c9655ce5796ac2dc70627b304f6fba3343d00b84a871f9ff9d93b9
MD5 a9efb2bc67ee929935e41a992b9d8d87
BLAKE2b-256 d45725f0625f89db2003a9cf3ab6c03816be60b20ce7c00244230ca0c9066069

See more details on using hashes here.

File details

Details for the file wellapi-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: wellapi-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 54.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.14

File hashes

Hashes for wellapi-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d86d728d232c85e972dba49bd8dfba16a0e3eb207b23c38a0c6422a01d9a8f86
MD5 067bdc616ad5530ddfa7c29e1f081461
BLAKE2b-256 c76d667de74d6287f6d5a91e7405c308ebcbf159d9fef38e66291abbb3800dc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page