How to use the datasette.views.special.JsonDataView.as_asgi function in datasette

To help you get started, we’ve selected a few datasette examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simonw / datasette / datasette / app.py View on Github external
r"/-/metadata(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "versions.json", self.versions),
            r"/-/versions(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "plugins.json", self.plugins),
            r"/-/plugins(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "config.json", lambda: self._config),
            r"/-/config(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "threads.json", self.threads),
            r"/-/threads(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "databases.json", self.connected_databases),
            r"/-/databases(?P(\.json)?)$",
        )
        add_route(
            DatabaseDownload.as_asgi(self), r"/(?P[^/]+?)(?P\.db)$"
        )
        add_route(
            DatabaseView.as_asgi(self),
            r"/(?P[^/]+?)(?P"
            + renderer_regex
            + r"|.jsono|\.csv)?$",
        )
        add_route(
github simonw / datasette / datasette / app.py View on Github external
add_route(
                    asgi_static(plugin["static_path"]),
                    "/-/static-plugins/{}/(?P
github simonw / datasette / datasette / app.py View on Github external
# Mount any plugin static/ directories
        for plugin in get_plugins(pm):
            if plugin["static_path"]:
                add_route(
                    asgi_static(plugin["static_path"]),
                    "/-/static-plugins/{}/(?P
github simonw / datasette / datasette / app.py View on Github external
r"/-/versions(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "plugins.json", self.plugins),
            r"/-/plugins(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "config.json", lambda: self._config),
            r"/-/config(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "threads.json", self.threads),
            r"/-/threads(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "databases.json", self.connected_databases),
            r"/-/databases(?P(\.json)?)$",
        )
        add_route(
            DatabaseDownload.as_asgi(self), r"/(?P[^/]+?)(?P\.db)$"
        )
        add_route(
            DatabaseView.as_asgi(self),
            r"/(?P[^/]+?)(?P"
            + renderer_regex
            + r"|.jsono|\.csv)?$",
        )
        add_route(
            TableView.as_asgi(self),
            r"/(?P[^/]+)/(?P[^/]+?$)",
        )
        add_route(
github simonw / datasette / datasette / app.py View on Github external
asgi_static(plugin["static_path"]),
                    "/-/static-plugins/{}/(?P
github simonw / datasette / datasette / app.py View on Github external
),
                )
        add_route(
            JsonDataView.as_asgi(self, "metadata.json", lambda: self._metadata),
            r"/-/metadata(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "versions.json", self.versions),
            r"/-/versions(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "plugins.json", self.plugins),
            r"/-/plugins(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "config.json", lambda: self._config),
            r"/-/config(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "threads.json", self.threads),
            r"/-/threads(?P(\.json)?)$",
        )
        add_route(
            JsonDataView.as_asgi(self, "databases.json", self.connected_databases),
            r"/-/databases(?P(\.json)?)$",
        )
        add_route(
            DatabaseDownload.as_asgi(self), r"/(?P[^/]+?)(?P\.db)$"
        )
        add_route(
            DatabaseView.as_asgi(self),
            r"/(?P[^/]+?)(?P"