aboutsummaryrefslogtreecommitdiffstats
path: root/run.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-03-22 21:30:06 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-03-22 21:30:30 -0700
commitdaf21f0b80e1783ed1eb777a7b6a9c5618c069d7 (patch)
treebb4107e1b6647d0d9ac37e525be29b02b3982b70 /run.py
parent33492754881a27c88f6a1ed38e463bba15ecf837 (diff)
downloadfatcat-daf21f0b80e1783ed1eb777a7b6a9c5618c069d7.tar.gz
fatcat-daf21f0b80e1783ed1eb777a7b6a9c5618c069d7.zip
restructure
Diffstat (limited to 'run.py')
-rw-r--r--run.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/run.py b/run.py
new file mode 100644
index 00000000..c8f492ea
--- /dev/null
+++ b/run.py
@@ -0,0 +1,27 @@
+
+import argparse
+from fatcat import app, db
+
+def main():
+ parser = argparse.ArgumentParser()
+ parser.add_argument('--debug',
+ action='store_true',
+ help="enable debugging interface")
+ parser.add_argument('--host',
+ default="127.0.0.1",
+ help="listen on this host/IP")
+ parser.add_argument('--port',
+ type=int,
+ default=8040,
+ help="listen on this port")
+ parser.add_argument('--database-uri',
+ default=app.config['DATABASE_URI'],
+ help="sqlalchemy database string")
+ args = parser.parse_args()
+
+ app.config['DATABASE_URI'] = args.database_uri
+ db.create_all()
+ app.run(debug=args.debug, host=args.host, port=args.port)
+
+if __name__ == '__main__':
+ main()