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])
For the future
- Recive files
- Handling post and get data
How did I do this?
References
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.4.tar.gz
(6.0 kB
view details)
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 octopusserver-0.1.4.tar.gz.
File metadata
- Download URL: octopusserver-0.1.4.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.5 Linux/5.4.0-137-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b2ce080ffc1469537c992238cb84f2daf51d66d05aa22d2110120c2937fa35e
|
|
| MD5 |
e1e71b3de4feb6be564c1d02ca19df09
|
|
| BLAKE2b-256 |
17440406f23091ca6323c2ad29628ec7b1be3e18bde890a8bd0392729c18c553
|
File details
Details for the file octopusserver-0.1.4-py3-none-any.whl.
File metadata
- Download URL: octopusserver-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.10.5 Linux/5.4.0-137-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54b579aa22f29b26c9edcf976148d39e8327dcff21089b4923d1ad07e61b4f8a
|
|
| MD5 |
68c828ce03b020f5ceab5d3633680b7a
|
|
| BLAKE2b-256 |
ef82b2866b31554a54f35d3196d39ff9c0e0d0716eeaecda9c69e7ae38194630
|