File: __main__.py

package info (click to toggle)
python-hug 2.6.0-2.4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,072 kB
  • sloc: python: 8,938; sh: 99; makefile: 17
file content (14 lines) | stat: -rw-r--r-- 261 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# pylint: disable=C0111, E0401
""" API Entry Point """

import hug


@hug.get("/", output=hug.output_format.html)
def base():
    return "<h1>hello world</h1>"


@hug.get("/add", examples="num=1")
def add(num: hug.types.number = 1):
    return {"res": num + 1}