Very often SVG makes sense, it will scale well with magnification. This idea does not deserve a separate answer so additionally I rewrote the code in a more idiomatic style:

    server = SocketListen[8000
    , Function[{assoc}
      , Module[
          { client = assoc["SourceSocket"], inputString, response}

        , inputString = ImportString[assoc["Data"], "HTTPRequest"] @ "Query" // Lookup["expr"]

        ; response = HTTPResponse[
            ExportString[ToExpression[inputString], "SVG"]
          , <|"ContentType" -> "image/svg+xml"|>
          ]

        ; WriteString[client, ExportString[response, "HTTPResponse"]]

        ; Close @ client
        ]
      ]      
    ]

[![enter image description here][1]][1]

    (* DeleteObject[server]
       Close[server["Socket"]]
    *)


  [1]: https://i.sstatic.net/7tZ25.png