1. Joel Mohler
  2. PyHacc

Commits

Joel Mohler  committed a85f1c0

bracket app-start code in __main__ conditional for sake of py.test

  • Participants
  • Parent commits 4307b57
  • Branches default

Comments (0)

Files changed (1)

File pyhacc/http/__main__.py

View file
 from serve import app
 import argparse
 
-parser = argparse.ArgumentParser(description='PyHacc http view')
-parser.add_argument('--conn', type=str, default='sqlite://', help='connection string sqlalchemy style')
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='PyHacc http view')
+    parser.add_argument('--conn', type=str, default='sqlite://', help='connection string sqlalchemy style')
+    args = parser.parse_args()
 
-args = parser.parse_args()
+    app.conn = args.conn
 
-app.conn = args.conn
-
-app.run(debug=True)
+    app.run(host='0.0.0.0', debug=True)