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.7.0.tar.gz (58.6 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.7.0-py3-none-any.whl (55.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wellapi-0.7.0.tar.gz
Algorithm Hash digest
SHA256 f50c8b9969b6eb803128e5b21552b10c2599559c2008511c27383a893293ae73
MD5 4e6605ccad609a69be524463b4d87387
BLAKE2b-256 d40010cd5ee5ab6cb984aee0cc41f79b4b7ad9cb3657d39b43b75d8b99fa467c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for wellapi-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b75ea0c527fc675c5a95c4d714af79f7df5e5b6955ad7f10e2220c178cb2dd50
MD5 d12b9fd0426f6bb2475f304fd8541d4f
BLAKE2b-256 3095de9224468de7a5eb5c9ee3b971802bb7688617766f39a3c9d967ca2ae3fd

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