diff --git a/ifcurl/service.py b/ifcurl/service.py index 70fccb2..500cf5f 100644 --- a/ifcurl/service.py +++ b/ifcurl/service.py @@ -184,9 +184,19 @@ class PreviewRequest(BaseModel): # --------------------------------------------------------------------------- -# Endpoint +# Endpoints # --------------------------------------------------------------------------- +@app.get("/preview") +def preview_get(url: str) -> Response: + """GET variant of POST /preview for use in HTML ```` tags. + + The ``url`` query parameter is the ifc:// URL to render. All caching + and authentication behaviour is identical to the POST endpoint. + """ + return preview(PreviewRequest(url=url)) + + @app.post("/preview") def preview(request: PreviewRequest) -> Response: """Render an ifc:// URL to a PNG image.