var inputEd, outputEd

var initialData = [
    {
        id: '{{index()}}',
        guid: '{{guid()}}',
        bool: '{{bool()}}',
        floating: '{{floating(-25.2, 25.0)}}',
        constant: 'http://www.google.com',
        integer: '{{integer()}}',
        rangedInteger: '{{integer(2, 10)}}',
        words: '{{lorem(3, "words")}}',
        sentence: '{{lorem(1, "sentence")}}',
        paragraph: '{{lorem(2, "paragraphs")}}',
        fullName: '{{firstName()}} X. {{lastName()}}',
        tags: [
            '{{lorem(1, "word")}}',
            '{{lorem(1, "word")}}',
            '{{lorem(1, "word")}}'
        ],
        people: [
            {
                firstName: '{{firstName()}}',
                lastName: '{{lastName()}}',
                age: '{{integer(2, 99)}}'
            },
            {
                firstName: '{{firstName()}}',
                lastName: '{{lastName()}}',
                age: '{{integer(2, 99)}}'
            }
        ]

    }
]

$(initCodeMirrors)

function initCodeMirrors () {
    inputEd = CodeMirror.fromTextArea(document.getElementById("jsonator-input"), {
        mode: "text/javascript",
        lineNumbers: true,
        theme: "monokai-dark-soda",
        lineWrapping: true,
        tabSize: 2
    })
    //inputEd.setValue(initialDataString)
    var initialJson = JSON.stringify(initialData, null, 2);
    initialJson = initialJson.replace(/\"([^(\")"]+)\":/g,"$1:");
    inputEd.setValue(initialJson);

    outputEd = CodeMirror.fromTextArea(document.getElementById("jsonator-output"), {
        mode: "application/json",
        lineNumbers: true,
        lineWrapping: true,
        theme: "monokai-dark-soda"
    });
}

function hideEndpointUrl () {
    $('#endpoint-url').slideUp();
}

function send () {
    var data = eval(inputEd.getValue());
    $.post('http://localhost/api/', {schema: JSON.stringify(data)}, function (res) {
        $.get('http://localhost/api/' + res.id, null, function (results) {
            var output = JSON.stringify(JSON.parse(results), null, 2)
            outputEd.setValue(output)

            $('#endpoint-url').find('a.url').text('http://localhost/api/' + res.id).attr('href', 'http://localhost/api/' + res.id);
            $('#endpoint-url').slideDown();
        })
    })
}
@@ -1826,33 +1826,46 @@
 ost('http://
-localhost
+jsonator.herokuapp.com
 /api/', %7Bsch
@@ -1927,33 +1927,46 @@
 get('http://
-localhost
+jsonator.herokuapp.com
 /api/' + res
@@ -2160,33 +2160,46 @@
 ext('http://
-localhost
+jsonator.herokuapp.com
 /api/' + res
@@ -2228,17 +2228,30 @@
 p://
-localhost
+jsonator.herokuapp.com
 /api

use heroku url