No project description provided
Project description
Octopusserver
How to install
Pypi
pip install octopusserver
Poetry
poetry add octopusserver
Getting Started
from octopusserver import Octopus
from octopusserver import Request
from octopusserver import Response
PORT = 3000
app = Octopus(PORT)
def hello_world(req: Request, res: Response):
res.send("Hello, World!")
app.router.get("/", [hello_world])
app.listen(lambda: print(f"Server listen on http://localhost:{ PORT }/"))
How to register your application's routes
from octopusserver import Octopus
PORT = 3000
app = Octopus(PORT)
router = app.router
router.get("path/to/get/route/", [trigger_get_route])
router.post("path/to/post/route/", [trigger_post_route])
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
octopusserver-0.1.1.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for octopusserver-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b58cbc4c41fbab74a5de38a6b95b97c1b2b00504645ea1b13c3315460d1aa95a |
|
MD5 | ff35f0a079239e38855e2754b9f9a344 |
|
BLAKE2b-256 | 2bfb96403dee1e79a41aa5929be7eca72b4b3978e7e18ec6d8f27d8557c36744 |