Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 873 Bytes

README.md

File metadata and controls

30 lines (20 loc) · 873 Bytes

D2 API

D2 is modern diagram scripting language. I was fascinated by it and noticed that one of the issue was about building a web-playground where people can try things out without much fuss of setting it up locally.

This API was built to support the project of playground

API Deploy details

URL to target: https://d2api.fly.dev/

Endpoint: /getSvg Request type: POST Payload type: json Payload details:

{
    "diagramCode": "# D2 script here.
    x -> y"
}

Response type: text/html Response: The generated svg for the provided D2 script, if the D2 script is valid.

D2 Playground

Using this API, I have built a basic D2 playground where you can play around and see if D2 fits your taste and use case.

Playground URL: https://d2play.yashbhalodi.me/