Skip to content

Instantly share code, notes, and snippets.

@crowelch
Created March 1, 2015 04:09
Show Gist options
  • Save crowelch/2f285be83aa8b7a61fd1 to your computer and use it in GitHub Desktop.
Save crowelch/2f285be83aa8b7a61fd1 to your computer and use it in GitHub Desktop.
/**
* Welcome to Pebble.js!
*
* This is where you write your app.
*/
var UI = require('ui');
var Settings = require('settings');
var main = new UI.Card({
title: 'Pebble.js',
icon: 'images/menu_icon.png',
subtitle: 'Hello World!',
body: 'Press any button.'
});
main.show();
// Set a configurable with just the close callback
Settings.config(
{ url: 'https://salty-sea-3552.herokuapp.com/' },
function(e) {
console.log('closed configurable');
// Show the parsed response
console.log(JSON.stringify(e.options));
// Show the raw response if parsing failed
if (e.failed) {
console.log(e.response);
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment