(host="0.0.0.0", port=RESTAPI_SERVER_PORT)
REST-JSON API server
REST-JSON API server
REST - JSON API server
def server(host="0.0.0.0", port=RESTAPI_SERVER_PORT):
    """
    REST-JSON API server
    """
    DataStore.admin_id = hexencode(os.urandom(16))
    Database.filepath = tempfile.mkstemp(prefix="sqlmapipc-", text=False)[1]

    logger.info("Running REST-JSON API server at '%s:%d'.." % (host, port))
    logger.info("Admin ID: %s" % DataStore.admin_id)
    logger.debug("IPC database: %s" % Database.filepath)

    # Initialize IPC database
    DataStore.current_db = Database()
    DataStore.current_db.connect()
    DataStore.current_db.init()

    # Run RESTful API
    run(host=host, port=port, quiet=True, debug=False)
def server ( host = "0.0.0.0" , port = RESTAPI_SERVER_PORT ) : DataStore . admin_id = hexencode ( os . urandom ( 16 ) ) Database . filepath = tempfile . mkstemp ( prefix = "sqlmapipc-" , text = False ) [ 1 ] logger . info ( "Running REST-JSON API server at '%s:%d'.." % ( host , port ) ) logger . info ( "Admin ID: %s" % DataStore . admin_id ) logger . debug ( "IPC database: %s" % Database . filepath ) # Initialize IPC database DataStore . current_db = Database ( ) DataStore . current_db . connect ( ) DataStore . current_db . init ( ) # Run RESTful API run ( host = host , port = port , quiet = True , debug = False )