def METHOD_NAME(*args, testmode=False, **kw):
    from ooniapi import views
    app = Flask(__name__)
    app.json_encoder = FlaskJSONEncoder
    # Order matters
    init_app(app, testmode=testmode)
    init_clickhouse_db(app)
    # Setup rate limiting
    limits = dict(
        ipaddr_per_month=60000,
        token_per_month=6000,
        ipaddr_per_week=20000,
        token_per_week=2000,
        ipaddr_per_day=4000,
        token_per_day=500,
    )
    # Whitelist Prometheus and AMS Explorer
    # TODO: move addrs to an external config file /etc/ooniapi.conf ?
    whitelist = ["37.218.245.43", "37.218.242.149"]
    unmetered_pages = ["/", "/health", "/report*"]
    app.limiter = FlaskLimiter(
        limits=limits,
        app=app,
        whitelisted_ipaddrs=whitelist,
        unmetered_pages=unmetered_pages,
    )
    Swagger(app, parse=True)
    # FIXME
    views.register(app)
    @app.route("/health")
    def health():
        """Health check
        ---
        responses:
          '200':
            description: Status
        """
        return "UP"
        # TODO: ping database?
        # option httpchk GET /check
        # http-check expect string success
    return app