Revize 5b57121e
Přidáno uživatelem Michal Seják před téměř 4 roky(ů)
app.py | ||
---|---|---|
1 | 1 |
from flask import Flask |
2 | 2 |
import os |
3 |
from src.controllers.certificates_controller import CertController |
|
3 | 4 |
|
4 | 5 |
app = Flask(__name__) |
5 | 6 |
|
... | ... | |
9 | 10 |
return 'Welcome to the X.509 management application homepage!' |
10 | 11 |
|
11 | 12 |
|
13 |
@app.route('/api/certificates', methods=["POST"]) |
|
14 |
def create_certificate(): |
|
15 |
return CertController.create_certificate() |
|
16 |
|
|
17 |
|
|
18 |
@app.route('/api/certificates', methods=["GET"]) |
|
19 |
def get_cert_list(): |
|
20 |
return CertController.get_certificate_list() |
|
21 |
|
|
22 |
|
|
12 | 23 |
if __name__ == '__main__': |
13 | 24 |
host = "0.0.0.0" |
14 | 25 |
port = 5000 |
... | ... | |
20 | 31 |
if "FLASK_PORT" in os.environ: |
21 | 32 |
host = os.environ["FLASK_PORT"] |
22 | 33 |
|
23 |
app.run(host=host, port=port) |
|
24 |
|
|
34 |
app.run(host=host, port=port) |
Také k dispozici: Unified diff
Re #8476 - Refactored the application; swagger is not used for code generation anymore, REST API is being implemented from scratch. Migration only, fixing tests.