Extensible API server
Project description
Murloc is an extensible API server.
To define API methods, use the route
decorator like so:
# main.py
from murloc import Murloc
app = Murloc()
@app.route("/hello")
def hello_world():
return "hello, world!"
@app.route("/echo")
def echo_data(data):
return data
You can also specify methods
directly as a dict()
during Murloc initialization:
# main.py
from murloc import Murloc
def hello_world():
return "hello, world!"
def echo_data(data):
return data
app = Murloc(methods={"/hello": hello_world, "/echo": echo_data})
Run the murloc server with uvicorn like so:
$ uvicorn main:app
Note: These examples assume main.py and the Murloc variable
app
.
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
murloc-0.1.1.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file murloc-0.1.1.tar.gz
.
File metadata
- Download URL: murloc-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e911942c10d0b48379e52c6af0ddbdcfdf9935be31cb73d5be1213959c8b40bf |
|
MD5 | 8fafa521dd200419072e8420b0277845 |
|
BLAKE2b-256 | 722c679a9e0dc86008eb2e0c7880ffe7edf5af9e2b1976e94c0bfb992d42e4fc |
File details
Details for the file murloc-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: murloc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5f08a09248c174b519806dcb2379b8aefb6df0091a2a6117691df113209c6bd |
|
MD5 | 2cc3b8eb46c29e06fd66547226a07d0e |
|
BLAKE2b-256 | f7349c849d04f8322f4e606bb20162f858818ce52e1e81de7e7028978277189f |