Skip to main content

No project description provided

Project description

Octopusserver

Octopus

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)

Uploaded Source

Built Distribution

octopusserver-0.1.1-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page