askrobots / dbbasic-object-primitive
Public
Python functions as REST objects, with clustering, load balancing and state replication; no containers or orchestration.
hello.py · 566 bytes · 30 lines
| 1 | """ |
| 2 | Simple hello world endpoint for testing |
| 3 | """ |
| 4 | |
| 5 | |
| 6 | def GET(request): |
| 7 | """Return a simple greeting""" |
| 8 | return { |
| 9 | 'status': 'ok', |
| 10 | 'message': 'Hello, World!', |
| 11 | 'method': 'GET', |
| 12 | } |
| 13 | |
| 14 | |
| 15 | def POST(request): |
| 16 | """Return a personalized greeting""" |
| 17 | name = request.get('name', 'World') |
| 18 | return { |
| 19 | 'status': 'ok', |
| 20 | 'message': f'Hello, {name}!', |
| 21 | 'method': 'POST', |
| 22 | } |
| 23 | |
| 24 | |
| 25 | __endpoint__ = { |
| 26 | 'name': 'hello', |
| 27 | 'description': 'Simple hello world endpoint for testing', |
| 28 | 'version': '1.0.0', |
| 29 | 'author': 'test', |
| 30 | } |