• ¶

    U.me example

    This example illustrates how to use the Unitag Engine API to render an HTML page (try it here).

  • ¶

    The raw JSON document can be found here.

    {
  • ¶

    Define the URL that will be used to access this operation. The resulting URL has the following form: http://e.unitag.io/r/{YOUR PATH HERE}.

        "url": "{YOUR PATH HERE}",
  • ¶

    Mark this operation as published. This is needed to make it publicly available.

        "state": "PUBLISHED",
  • ¶

    Define the default entry point of this operation.

        "index": {
  • ¶

    Render the following U.me and send the HTML result.

            "ume": {
  • ¶

    Define the root U.me block, which contains a single page.

                "type": "ume",
                "blocks": {
                    "type": "static-page",
                    "blocks": [
  • ¶

    Define a simple random image.

                        {
                            "type": "bind-image",
                            "data": {
                                "src": "http://lorempixel.com/1024/256/abstract/"
                            }
                        },
  • ¶

    Define a simple H1 title.

                        {
                            "type": "static-text",
                            "properties": {
                                "element": "h1"
                            },
                            "data": {
                                "text": "U.me scratchcard"
                            }
                        },
  • ¶

    Define a scratchcard containing a map.

                        {
                            "type": "ume-scratch",
                            "blocks": {
                                "type": "bind-map",
                                "css": "{height: 300px}"
                            }
                        }
                    ]
                }
            }
        }
    }