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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wellapi-0.6.4.tar.gz.
File metadata
- Download URL: wellapi-0.6.4.tar.gz
- Upload date:
- Size: 56.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4638774e7a04f4272c7c682777a60dd9b91234746e28a864fdf7d004f9209bc1
|
|
| MD5 |
3f9191181eaf8f1a9f98b45086cc354a
|
|
| BLAKE2b-256 |
08882278f69b1f967ae0ef52fd79bfebe07d83b9d3e2f27c1823c9792a24102f
|
File details
Details for the file wellapi-0.6.4-py3-none-any.whl.
File metadata
- Download URL: wellapi-0.6.4-py3-none-any.whl
- Upload date:
- Size: 56.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1988bfa887919acece5a2cd19ba0a597d5f03364a1e3c0e16f9e0de546bd7d85
|
|
| MD5 |
7240b49b2ffec5b5ae3abad76fbfe232
|
|
| BLAKE2b-256 |
edc3a63bff3278dff8a6ebd870dad868596b1e2e52db608008e68732409981d5
|