From d065994b3b81e17eb783146c0ddeaaf8325d445d Mon Sep 17 00:00:00 2001 From: Muneeb Ali Date: Sun, 9 Apr 2017 14:28:09 -0400 Subject: [PATCH] for starting the flask api (instead of runserver.py) --- bin/blockstack-api | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 bin/blockstack-api diff --git a/bin/blockstack-api b/bin/blockstack-api new file mode 100755 index 000000000..62bbff35b --- /dev/null +++ b/bin/blockstack-api @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" + Blockstack + ~~~~~ + + copyright: (c) 2014-2017 by Blockstack Inc. + copyright: (c) 2017 by Blockstack.org + +This file is part of Blockstack. + + Blockstack is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Blockstack is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Blockstack. If not, see . +""" + +import os +import sys + +# hack around absolute paths +current_dir = os.path.abspath(os.path.dirname(__file__)) +parent_dir = os.path.abspath(current_dir + "/../") + +sys.path.insert(0, parent_dir) + +from api.server import app +from api.config import DEFAULT_HOST, DEFAULT_PORT + + +def runserver(): + app.run(host=DEFAULT_HOST, port=DEFAULT_PORT) + +if __name__ == '__main__': + runserver()