def main(): app = service.create_app(default_name='ispindel') # Init events add_events(app) # Register routes app.router.add_routes(routes) # Add all default endpoints, and adds prefix to all endpoints # # Default endpoints are: # {prefix}/api/doc (Swagger documentation of endpoints) # {prefix}/_service/status (Health check: this endpoint is called to check service status) # # The prefix is automatically added for all endpoints. You don't have to do anything for this. # To change the prefix, you can use the --name command line argument. # # See brewblox_service.service for more details on how arguments are parsed. # # The default value is "YOUR_PACKAGE" (provided in service.create_app()). # This means you can now access the example/endpoint as "/YOUR_PACKAGE/example/endpoint" service.furnish(app) # service.run() will start serving clients async service.run(app)
def main(): app = service.create_app(parser=create_parser()) scheduler.setup(app) mqtt.setup(app) http.setup(app) broadcaster.setup(app) service.furnish(app) service.run(app)
def main(): app = service.create_app(parser=create_parser()) scheduler.setup(app) mqtt.setup(app) relay.setup(app) service.furnish(app) service.run(app)
def main(args=sys.argv): if '--cli' in args: cli() return app = service.create_app(default_name='mdns') logging.captureWarnings(True) dns_discovery.setup(app) service.furnish(app) service.run(app)
def main(): app = service.create_app(parser=create_parser()) logging.captureWarnings(True) config = app['config'] app['ini'] = parse_ini(app) if getenv('ENABLE_DEBUGGER', False): # pragma: no cover import debugpy debugpy.listen(('0.0.0.0', 5678)) LOGGER.info('Debugger is enabled and listening on 5678') if config['simulation']: config['device_id'] = config['device_id'] or '123456789012345678901234' config['device_host'] = 'localhost' config['device_port'] = 8332 config['device_serial'] = None simulator.setup(app) service_status.setup(app) http.setup(app) connection.setup(app) commander.setup(app) scheduler.setup(app) mqtt.setup(app) config_store.setup(app) block_store.setup(app) block_cache.setup(app) unit_conversion.setup(app) codec.setup(app) spark.setup(app) broadcaster.setup(app) error_response.setup(app) debug_api.setup(app) blocks_api.setup(app) system_api.setup(app) settings_api.setup(app) mqtt_api.setup(app) if config['simulation']: sim_api.setup(app) synchronization.setup(app) service.furnish(app) service.run(app)
def main(): app = service.create_app(default_name='simulator') # Add implementation-specific functionality # In this case: simulator simulator.setup(app) # Event handling is optional # It should be enabled explicitly by service implementations events.setup(app) # Add all default endpoints service.furnish(app) # service.run() will start serving clients async service.run(app)
def main(): app = service.create_app(parser=create_parser()) scheduler.setup(app) events.setup(app) influx.setup(app) query_api.setup(app) sse.setup(app) relays.setup(app) relays.subscribe(app, exchange_name=OLD_EXCHANGE, routing='#') relays.subscribe(app, exchange_name=app['config']['broadcast_exchange'], routing='#') service.furnish(app) service.run(app)
def main(): app = service.create_app(parser=create_parser()) scheduler.setup(app) http.setup(app) mqtt.setup(app) socket_closer.setup(app) victoria.setup(app) timeseries_api.setup(app) redis.setup(app) datastore_api.setup(app) relays.setup(app) app.middlewares.append(controller_error_middleware) service.furnish(app) service.run(app)
def main(): app = service.create_app(parser=create_parser()) # Both tiltScanner and event handling requires the task scheduler scheduler.setup(app) # Initialize event handling mqtt.setup(app) # Initialize your feature tiltScanner.setup(app) # Add all default endpoints service.furnish(app) # service.run() will start serving clients async service.run(app)
def main(): app = service.create_app(parser=create_parser()) logging.captureWarnings(True) config = app['config'] if config['list_devices']: LOGGER.info('Listing connected devices: ') for dev in [[v for v in p] for p in communication.all_ports()]: LOGGER.info(f'>> {" | ".join(dev)}') # Exit application return status.setup(app) http_client.setup(app) if config['simulation']: commander_sim.setup(app) else: communication.setup(app) commander.setup(app) scheduler.setup(app) events.setup(app) couchdb_client.setup(app) datastore.setup(app) codec.setup(app) device.setup(app) broadcaster.setup(app) error_response.setup(app) debug_api.setup(app) alias_api.setup(app) object_api.setup(app) system_api.setup(app) remote_api.setup(app) codec_api.setup(app) sse_api.setup(app) seeder.setup(app) service.furnish(app) service.run(app)
def main(): app = service.create_app(parser=create_parser()) # Enable the task scheduler # This is required for the `events` feature, # and for the RepeaterFeature used in poll_example scheduler.setup(app) # Enable event handling # Event subscription / publishing will be enabled after you call this function events.setup(app) # Enable making HTTP requests # This allows you to access a shared aiohttp ClientSession # https://docs.aiohttp.org/en/stable/client_reference.html http.setup(app) # To keep everything consistent, examples also have the setup() function # In here they register everything that must be done before the service starts # It's not required to use this pattern, but it makes code easier to understand events_example.setup(app) poll_example.setup(app) http_example.setup(app) # Add all default endpoints, and adds prefix to all endpoints # # Default endpoints are: # {prefix}/api/doc (Swagger documentation of endpoints) # {prefix}/_service/status (Health check: this endpoint is called to check service status) # # The prefix is automatically added for all endpoints. You don't have to do anything for this. # To change the prefix, you can use the --name command line argument. # # See brewblox_service.service for more details on how arguments are parsed. # # The default value is "YOUR_PACKAGE" (provided in service.create_app()). # This means you can now access the example/endpoint as "/YOUR_PACKAGE/example/endpoint" service.furnish(app) # service.run() will start serving clients async service.run(app)
def main(): app = service.create_app(default_name='history') # Setup history functionality events.setup(app) influx.setup(app) # Add all default endpoints and add prefix # # Default endpoints are: # {prefix}/api/doc (Swagger documentation of endpoints) # {prefix}/_service/status (Health check: this endpoint is called to check service status) # # The prefix is automatically added for all endpoints. You don't have to do anything for this. # To change the prefix, you can use the --name command line argument. # # See brewblox_service.service for more details on how arguments are parsed. # # The default value is "brewblox". # This means you can now access the example/endpoint as "/brewblox/example/endpoint" service.furnish(app) # service.run() will start serving clients async service.run(app)
async def app(app, mocker): app.router.add_static(prefix='/static', path='/usr') service.furnish(app) return app