From 53a286ee1564b4216d1d1d1bc447612dab343ced Mon Sep 17 00:00:00 2001 From: Sergey Chizhik Date: Sun, 4 Oct 2015 10:58:14 +0300 Subject: [PATCH] Add ability to specify port,host to run on --- httpbin/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httpbin/core.py b/httpbin/core.py index d422c59..bbac37d 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -13,6 +13,7 @@ import os import random import time import uuid +import sys from flask import Flask, Response, request, render_template, redirect, jsonify as flask_jsonify, make_response, url_for from werkzeug.datastructures import WWWAuthenticate, MultiDict @@ -711,4 +712,4 @@ def xml(): if __name__ == '__main__': - app.run() + app.run(port=int(sys.argv[1]) if (len(sys.argv) > 1) else 5000, host=sys.argv[2] if (len(sys.argv) > 2) else "127.0.0.1")