Sha256: 23fdd222f412c3332ae32e291a67a52179a7443d8d9ab156cea6439ca7ad0fc3

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

require 'sinatra'
require 'coffee-script'
require_relative '../../lib/lift'

configure do
  mime_type :plain, 'text/plain'
end

get '/' do
  haml :index
end

post '/dashboard.json' do
  client = LiftAPI::Client.new(email: params[:email], password: params[:password])
  content_type :json
  client.dashboard.to_json
end

get '/checkins/:user/:habit' do
  content_type :plain
  client = LiftAPI::Client.new(profile_hash: params[:user])
  data   = client.checkin_data(params[:habit])
  output = data[:checkins].map { |d| d.strftime('%Y-%m-%d') }
  output.unshift data[:'habit-name']
  output.join("\n")
end

get '/application.js' do
  coffee :application
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
liftapp-client-0.0.1 examples/csv_export/app.rb