#run a test server
import pdb
from flask import json, current_app

from citadel import app
from citadel.rest_api import api
from config import *

if __name__ == '__main__':
    with app.app_context():
        print("==========")
        print(json.dumps(api.__schema__))
        print("==========")
    print(app.config)
    app.run(host=CITADEL_HOST, port=CITADEL_PORT, debug=True)

@@ -137,16 +137,32 @@
 import *
+%0Aimport argparse
 %0A%0Aif __n
@@ -190,152 +190,426 @@
     
-with app.app_context():%0A        print(%22==========%22)%0A        print(json.dumps(api.__schema__))%0A        print(%22==========%22)%0A    print(app.config
+debug = True%0A    host = CITADEL_HOST%0A    port = CITADEL_PORT%0A%0A    parser = argparse.ArgumentParser(description='Run Citadel web service.')%0A    parser.add_argument('-host', dest='host', default=host,%0A        help='ip bind address (default: ' + host + ')')%0A    parser.add_argument('-p', dest='port', type=int, default=port,%0A        help='port to listen on (default: ' + str(port) + ')')%0A%0A    args = parser.parse_args(
 )%0A
+%0A
     
@@ -620,54 +620,33 @@
 run(
-host=CITADEL_HOST, port=CITADEL_PORT
+args.host, args.port
 , debug
-=True
 )%0A

resolve conflict