mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-09 12:27:46 +00:00
Add example
This commit is contained in:
12
examples/helloworld/hello.py
Executable file
12
examples/helloworld/hello.py
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import connexion
|
||||
|
||||
|
||||
def post_greeting(name: str) -> str:
|
||||
return 'Hello {name}'.format(name=name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app = connexion.App(__name__, 9090, specification_dir='swagger/')
|
||||
app.add_api('helloworld-api.yaml')
|
||||
app.run()
|
||||
Reference in New Issue
Block a user