$(() => { // load config $.get("/config.json", (data) => { $('.js-config').val(JSON.stringify(data, null, 4)); }); // add handlers $('.js-restart').click(()=>{ $.post('/restart'); alert('restarting...'); }); });