Beispiel #1
0
def main():
    description = 'Start a single-threaded instance of jumpgate.'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('--config',
                        default=os.environ.get('JUMPGATE_CONFIG'),
                        help='Jumpgate config location')
    parser.add_argument('--host',
                        default='127.0.0.1',
                        help='host to listen on')
    parser.add_argument('--port',
                        type=int,
                        default=5000,
                        help='port to listen on')

    args = parser.parse_args()
    httpd = simple_server.make_server(args.host,
                                      args.port,
                                      wsgi.make_api(args.config))
    print("Starting server on (%s:%s)" % (args.host, args.port))
    print("""
Warning: This is currently a test server for Jumpgate and not fit for
production since it is single-threaded. Use the WSGI application directly
along with a better wsgi server like gunicorn or uwsgi:
    jumpgate.wsgi:make_api()""")
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print("Exiting...")
Beispiel #2
0
def main():
    description = 'Start a single-threaded instance of jumpgate.'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('--config',
                        default=os.environ.get('JUMPGATE_CONFIG'),
                        help='Jumpgate config location')
    parser.add_argument('--host',
                        default='127.0.0.1',
                        help='host to listen on')
    parser.add_argument('--port',
                        type=int,
                        default=5000,
                        help='port to listen on')

    args = parser.parse_args()
    httpd = make_server(args.host, args.port, make_api(args.config))
    print("Starting server on (%s:%s)" % (args.host, args.port))
    print("""
Warning: This is currently a test server for Jumpgate and not fit for
production since it is single-threaded. Use the WSGI application directly
along with a better wsgi server like gunicorn or uwsgi:
    jumpgate.wsgi:make_api()""")
    try:
        httpd.serve_forever()
    except KeyboardInterrupt:
        print("Exiting...")
Beispiel #3
0
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


from jumpgate import wsgi

application = wsgi.make_api()
Beispiel #4
0
    def test_make_api(self):
        new_api = make_api()

        self.assertTrue(hasattr(new_api, '__call__'))
        self.assertIsInstance(new_api, falcon.API)