initial checkin of full application

This commit is contained in:
ioBridge
2011-03-27 16:56:15 -04:00
parent a36868bc86
commit 740a1b338c
127 changed files with 13777 additions and 0 deletions

42
config/application.rb Normal file
View File

@ -0,0 +1,42 @@
require File.expand_path('../boot', __FILE__)
require 'rails/all'
# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
module Thingspeak
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Custom directories with classes and modules you want to be autoloadable.
# config.autoload_paths += %W(#{config.root}/extras)
# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named.
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
# Activate observers that should always be running.
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# JavaScript files you want as :defaults (application.js is always included).
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
end
end

13
config/boot.rb Normal file
View File

@ -0,0 +1,13 @@
require 'rubygems'
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)

View File

@ -0,0 +1,49 @@
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql
# On Mac OS X:
# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
# On Mac OS X Leopard:
# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
# This sets the ARCHFLAGS environment variable to your native architecture
# On Windows:
# gem install mysql
# Choose the win32 build.
# Install MySQL and put its /bin directory on your path.
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql
encoding: utf8
reconnect: false
database: thingspeak_development
pool: 5
username: thing
password: "speak"
# socket: /var/lib/mysql/mysql.sock
socket: /var/run/mysqld/mysqld.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql
encoding: utf8
reconnect: false
database: thingspeak_test
pool: 5
username: thing
password: "speak"
# socket: /var/lib/mysql/mysql.sock
socket: /var/run/mysqld/mysqld.sock
production:
adapter: mysql
encoding: utf8
reconnect: true
database: thingspeak_production
pool: 5
username: thing
password: "speak"

21
config/environment.rb Normal file
View File

@ -0,0 +1,21 @@
# Load the rails application
require File.expand_path('../application', __FILE__)
Thingspeak::Application.configure do
config.action_controller.perform_caching = true
config.cache_store = :file_store, "#{Rails.root}/tmp/cache"
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:domain => '',
:authentication => :plain,
:user_name => '',
:password => ''
}
end
# Initialize the rails application
Thingspeak::Application.initialize!

View File

@ -0,0 +1,26 @@
Thingspeak::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
config.cache_classes = false
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = true
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
end

View File

@ -0,0 +1,49 @@
Thingspeak::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# See only warnings or higher in the log (default is :info)
config.log_level = :warn
# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# Use a different cache store in production
# config.cache_store = :mem_cache_store
# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false
# Enable serving of images, stylesheets, and javascripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"
# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
# Enable threaded mode
# config.threadsafe!
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation can not be found)
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners
config.active_support.deprecation = :notify
end

View File

@ -0,0 +1,35 @@
Thingspeak::Application.configure do
# Settings specified here will take precedence over those in config/environment.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
config.cache_classes = true
# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true
# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Raise exceptions instead of rendering exception templates
config.action_dispatch.show_exceptions = false
# Disable request forgery protection in test environment
config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
# like if you have constraints or database-specific column types
# config.active_record.schema_format = :sql
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
end

View File

@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
# Rails.backtrace_cleaner.remove_silencers!

View File

@ -0,0 +1,3 @@
# allow updates via HTTP GET by setting this to true;
# set to false to only allow updates via HTTP POST
GET_SUPPORT = true

View File

@ -0,0 +1,10 @@
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end

View File

@ -0,0 +1,5 @@
# Be sure to restart your server when you modify this file.
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone

View File

@ -0,0 +1,7 @@
# Be sure to restart your server when you modify this file.
# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
Thingspeak::Application.config.secret_token = '44a84c8a4b53e95aecc92b38a267eaef3853d876968ad30f0b21023922b9dbaed1976e8a29884121e124720bfe3a13f8b1b0078f94f840866f83fc9bfbd75f73'

View File

@ -0,0 +1,8 @@
# Be sure to restart your server when you modify this file.
Thingspeak::Application.config.session_store :cookie_store, :key => '_thingspeak_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rake db:sessions:create")
# Thingspeak::Application.config.session_store :active_record_store

242
config/locales/en.yml Normal file
View File

@ -0,0 +1,242 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
# IMPORTANT!! prepend lines with spaces not tabs
en:
time:
formats:
pretty: "%a, %b %e at %l:%M %p"
about: "About"
account_changes: "Confirm account changes"
account_edit: "Edit Account Information"
account_edit_submit: "Edit Account"
account_error: "There were some problems creating your account:"
account_error_edit: "There were some problems editing your account:"
account_info: "Account Information"
account_not_found: "Your account could not be located."
account_security: "For security purposes, your current password must be entered."
action: "Action"
admin: "Admin"
api_key: "API Key"
api_key_delete: "Delete API Key"
api_key_key: "Key"
api_key_read: "Read API Keys"
api_key_read_new: "Generate New Read API Key"
api_key_write: "Write API Key"
api_key_write_new: "Generate New Write API Key"
api_keys: "API Keys"
api_keys_manage: "Manage API Keys"
application_name: "ThingSpeak"
apps: "Apps"
authorization: "Authorization"
average: "Average"
back: "Back"
blog: "Blog"
channel: "Channel"
channel_clear: "Clear Channel"
channel_clear_message: "Want to clear all feed data from this channel?"
channel_create: "Create New Channel"
channel_edit: "Edit Channel"
channel_error: "There were some problems creating your channel:"
channel_feed: "View Channel Feed"
channel_default_field: "Field Label"
channel_default_name: "Channel"
channel_delete: "Delete Channel"
channel_delete_message: "Want to delete this channel?"
channel_description: "Description"
channel_id: "Channel ID"
channel_name: "Name"
channel_not_public: "This channel is not public."
channel_permission: "You don't have permission to view that channel!"
channel_public: "Viewing public channel"
channel_update: "Update Channel"
channels: "Channels"
chart_background_color: "Background"
chart_embed_code: "Embed Code"
chart_example: "Example Chart"
chart_color: "Color"
chart_no_access: "This channel is not public. To embed charts, the channel must be public or a read key must be specified."
chart_owned: "Your Charts"
chart_round: "Rounding"
chart_type: "Type"
chart_update: "Update"
chart_xaxis: "X-Axis"
chart_yaxis: "Y-Axis"
charts: "Charts"
charts_view: "View Charts"
community: "Community"
confirm_read_key_delete: "Are you sure you want to delete this Read API Key?"
confirm_channel_clear: "Are you sure you want to clear this channel?"
confirm_channel_delete: "Are you sure you want to delete this channel?"
confirm_device_delete: "Are you sure you want to delete this device?"
confirm_device_random_mac: "Are you sure you want to generate a random MAC address for this device?"
confirm_device_unique_mac: "Are you sure you want to generate a unique MAC address for this device?"
confirm_new_api_key: "Are you sure you want to generate a new write API key?"
confirm_new_thinghttp_key: "Are you sure you want to generate a new ThingHTTP API key?"
confirm_new_thingtweet_key: "Are you sure you want to generate a new ThingTweet API key?"
confirm_plugin_delete: "Are you sure you want to delete this plugin?"
confirm_thinghttp_delete: "Are you sure you want to delete this ThingHTTP?"
confirm_twitter_delete: "Are you sure you want to unlink this Twitter account?"
create_account: "Create Account"
created: "Created"
days: "Days"
delete: "delete"
device_create: "Add New Device"
device_default_name: "Device"
device_delete: "Delete Device"
device_delete_message: "Want to delete this device?"
device_edit: "Edit Device"
device_error: "There were some problems creating your device:"
device_ip_address: "Public IP Address"
device_mac: "MAC Address"
device_model: "Model"
device_port: "Public Port Number"
device_random_mac: "Generate Random MAC Address"
device_title: "Title"
device_unique_mac: "Generate Unique MAC Address"
devices: "Devices"
documentation: "Documentation"
edit: "Edit"
elevation: "Elevation"
email: "Email"
email_form_add: "Add Email"
field: "Field"
footer: "This is the footer message."
forgot: "Forgot your password?"
forum: "Forum"
height: "Height"
home: "Home"
homepage: "ThingSpeak is an Open Internet of Things project by ioBridge."
homepage_logged_in: "Homepage for logged in user!"
latitude: "Latitude"
longitude: "Longitude"
median: "Median"
myaccount: "Account"
note: "Note"
note_save: "Save Note"
password: "Password"
password_change_raw: "Change<br />Password"
password_confirmation: "Password Confirmation"
password_confirmation_raw: "Password<br />Confirmation"
password_current_raw: "Current<br />Password"
password_forgot: "Forgot your password?"
password_forgot_message: "Enter your email address below and we'll send you a link where you can reset your password."
password_incorrect: "Your current password was not entered correctly."
password_link_expired: "Your password reset link has expired."
password_new: "Create New Password"
password_new_choose: "Choose a secure password for your account."
password_new_confirmation: "Enter your password again for confirmation."
password_new_error: "There were some problems with your new password:"
password_problem: "Your password is too short or your confirmation did not match."
password_reset_message1: "A request to reset your password has been made."
password_reset_message2: "If you did not make this request, simply ignore this email."
password_reset_message3: "If you did make this request, please follow the link below:"
password_reset_error: "An error has occurred while sending you password reset instructions."
password_reset_mailed: "Instructions to reset your password have been emailed to you."
password_reset_subject: "ThingSpeak password reset instructions"
plugin: "Plugin"
plugin_create: "Create New Plugin"
plugin_css: "CSS"
plugin_default_name: "Plugin"
plugin_delete: "Delete Plugin"
plugin_delete_message: "Want to delete this Plugin?"
plugin_edit: "Save Data"
plugin_html: "HTML"
plugin_js: "JavaScript"
plugin_name: "Name"
plugin_permission: "You don't have permission to access this plugin!"
plugins: "Plugins"
public: "Make Public?"
questions: "Questions"
remember_me: "Remember my User ID"
rss: "RSS Feed"
saved: "Saved."
saved_error: "Error while saving data."
search_empty: "No search results were found."
secure_signin: "Secure Sign In"
signin: "Sign In"
signin_failure: "Sign In Failure"
signin_please: "Please sign in to access your account."
signin_try_again: "Incorrect User ID or Password. Please try again."
signout: "Sign Out"
signup: "Sign Up"
signup_header: "Sign up to start using ThingSpeak"
submit: "Submit"
sum: "Sum"
tags: "Tags"
tags_search: "Search Channels"
thinghttp: "ThingHTTP"
thinghttp_auth_name: "HTTP Auth Username"
thinghttp_auth_pass: "HTTP Auth Password"
thinghttp_body: "Body"
thinghttp_content_type: "Content Type"
thinghttp_create: "Create New Request"
thinghttp_default_name: "Request"
thinghttp_delete: "Delete Request"
thinghttp_delete_message: "Want to delete this Request?"
thinghttp_edit: "Edit Request"
thinghttp_header_add: "add new header"
thinghttp_header_name: "Name"
thinghttp_header_remove: "remove header"
thinghttp_header_value: "Value"
thinghttp_headers: "Headers"
thinghttp_host: "Host"
thinghttp_http_version: "HTTP Version"
thinghttp_id: "Request ID"
thinghttp_invalid_api_key: "Invalid API Key"
thinghttp_loop: "Please don't try to send ThingHTTP into a loop!"
thinghttp_method: "Method"
thinghttp_name: "Name"
thinghttp_new_api_key: "Regenerate API Key"
thinghttp_parse: "Parse String"
thinghttp_parse_error: "Error parsing document, try a different parse string."
thinghttp_permission: "You don't have permission to view that ThingHTTP!"
thingtweet: "ThingTweet"
thingtweet_back: "Back to ThingTweet"
time_zone: "Time Zone"
timescale: "Timescale"
title: "Title"
tos: "Terms of Service"
tos_agree: "By signing up, you agree to the"
try_again: "Please try again!"
twitter_accounts: "Current Twitter accounts"
twitter_delete: "Unlink Account"
twitter_failure: "Twitter failure."
twitter_invalid_api_key: "Invalid API Key"
twitter_link_account: "Link Twitter Account"
twitter_link_success: "has been successfully linked to ThingTweet."
twitter_new_api_key: "Regenerate API Key"
twitter_screen_name: "Twitter Screen Name"
url: "URL"
userid: "User ID"
width: "Width"
# help section
help: "Help"
help_apps_thinghttp: "Create custom POSTs or GETs to other webservices and retrieve the data."
help_apps_thingtweet: "Link your Twitter account to ThingSpeak and send Twitter messages using our simple API."
help_channel: "Create a channel -- it can be for a device, app, or anything that can send data to ThingSpeak."
help_channel_clear: "Clicking on the \"Clear Channel\" button will delete ALL feed data associated with this channel, but will leave the channel's info intact."
help_channel_feed: "Viewing Data"
help_channel_fields: "Add up to 8 fields that can be tracked. A field must be added before it can store data."
help_channel_post: "Add data by sending a POST or GET to:"
help_channel_post_example: "Please include your write API key and some data, for example:"
help_channel_public: "Make this channel public to allow anyone to view its feed and charts without using API keys."
help_channel_read_key: "Read API keys can be used to allow other people to view your channel's feed and charts."
help_channel_read_key_note: "Notes are for your personal use, and can be used to keep track of who you give out read keys to."
help_channel_update: "Sending Data"
help_channel_view: "View your channel's data at:"
help_channel_write_key: "Use your write API key to read or write data to this channel."
help_charts: "Help With Charts"
help_charts_embed: "The embed code can then be added to any webpage, and your customized chart will appear there."
help_charts_options: "Create customized charts by choosing your options and clicking on \"Update\"."
help_device: "Add your device and store its info on ThingSpeak."
help_device_edit: "Add your device's info on this page. You can assign a MAC address on the next page."
help_device_show: "Generate a completely random MAC address, or use one of ThingSpeak's reserved MAC addresses, where each one is unique."
help_plugins: "Plugins allow you to create custom HTML, JavaScript, and CSS files that can be used to parse and display your data."
help_thinghttp: "Use ThingHTTP to access other APIs or webpages and parse the responses. You can create and save a full HTTP request to any URL, and then easily access it by using your ThingHTTP API key."
help_thinghttp_edit: "Create your custom HTTP request on this page. For example, try the following options:"
help_thinghttp_example: "This will send your HTTP GET request to Google Finance and parse the response for an element having an ID of ref_626307_c, which corresponds to the S&P 500 current price change for the day."
help_thinghttp_show: "You can now send your ThingHTTP request and view the response using the following URL:"
help_thingtweet: "ThingTweet acts as a proxy to Twitter so that your devices can update Twitter statuses without having to implement Open Authentication (OAuth)."
help_options: "more help"

97
config/locales/en.yml.old Normal file
View File

@ -0,0 +1,97 @@
# Sample localization file for English. Add more files in this directory for other locales.
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
# IMPORTANT!! prepend lines with spaces not tabs
en:
time:
formats:
pretty: "%a, %b %e at %l:%M %p"
account_changes: "Confirm account changes"
account_edit: "Edit account information"
account_edit_submit: "Edit my account"
account_error: "There were some problems creating your account:"
account_error_edit: "There were some problems editing your account:"
account_info: "Account Information"
account_not_found: "Your account could not be located."
account_security: "For security purposes, your current password must be entered."
api_key: "API Key"
api_key_delete: "Delete API Key"
api_key_key: "Key"
api_key_read: "Read API Keys"
api_key_read_new: "Generate New Read API Key"
api_key_write: "Write API Key"
api_key_write_new: "Generate New Write API Key"
api_keys_manage: "Manage API Keys"
application_name: "ThingSpeak2"
back: "Back"
channel_create: "Create New Channel"
channel_edit: "Edit Channel"
channel_error: "There were some problems creating your channel:"
channel_feed: "View channel feed"
channel_default_field: "Field Label"
channel_default_name: "Channel"
channel_delete: "Delete Channel"
channel_delete_message: "Want to delete this channel?"
channel_description: "Description"
channel_name: "Name"
channel_not_public: "This channel is not public."
channel_permission: "You don't have permission to view that channel!"
channel_public: "Viewing public channel"
channel_update: "Update Channel"
channels: "Channels"
confirm_channel_delete: "Are you sure you want to delete this channel?"
confirm_new_api_key: "Are you sure you want to generate a new write API key?"
create_account: "Create my account"
created: "Created"
delete: "delete"
elevation: "Elevation"
email: "Email"
email_form_add: "Add Email"
field: "Field"
footer: "This is the footer message."
forgot: "Forgot your password?"
home: "Home"
homepage: "ThingsSpeak is an Open Internet of Things project by ioBridge."
homepage_logged_in: "Homepage for logged in user!"
latitude: "Latitude"
longitude: "Longitude"
myaccount: "My Account"
note: "Note"
note_save: "Save Note"
password: "Password"
password_change_raw: "Change<br />Password"
password_confirmation: "Password Confirmation"
password_confirmation_raw: "Password<br />Confirmation"
password_current_raw: "Current<br />Password"
password_forgot: "Forgot your password?"
password_forgot_message: "Enter your email address below and we'll send you a link where you can reset your password."
password_incorrect: "Your current password was not entered correctly."
password_link_expired: "Your password reset link has expired."
password_new: "Create New Password"
password_new_choose: "Choose a secure password for your account."
password_new_confirmation: "Enter your password again for confirmation."
password_new_error: "There were some problems with your new password:"
password_problem: "Your password is too short or your confirmation did not match."
password_reset_message1: "A request to reset your password has been made."
password_reset_message2: "If you did not make this request, simply ignore this email."
password_reset_message3: "If you did make this request, please follow the link below:"
password_reset_error: "An error has occurred while sending you password reset instructions."
password_reset_mailed: "Instructions to reset your password have been emailed to you."
password_reset_subject: "ThingSpeak password reset instructions"
public: "Make Public?"
questions: "Questions"
remember_me: "Remember my User ID"
secure_signin: "Secure Sign In"
signin: "Sign In"
signin_failure: "Sign In Failure"
signin_please: "Please sign in to access your account."
signin_try_again: "Incorrect User ID or Password. Please try again."
signout: "Sign Out"
signup: "Sign Up"
signup_header: "Sign up to start using ThingSpeak"
submit: "Submit"
time_zone: "Time Zone"
tos: "Terms of Service"
tos_agree: "By signing up, you agree to the"
try_again: "Please try again!"
userid: "User ID"

33
config/routes.rb Normal file
View File

@ -0,0 +1,33 @@
Thingspeak::Application.routes.draw do
# main data posts using this route
match 'update', :to => 'channels#post_data', :as => 'update', :via => ((GET_SUPPORT) ? ['get', 'post'] : 'post')
# handle subdomain routes
match '/', :to => 'subdomains#index', :constraints => { :subdomain => 'api' }
match 'crossdomain', :to => 'subdomains#crossdomain', :constraints => { :subdomain => 'api' }
root :to => 'pages#home'
resource :user_session
resource 'account', :to => 'users'
resources :users
# specific feeds
match 'channels/:channel_id/field/:field_id(.:format)' => 'feed#index'
match 'channels/:channel_id/feed/entry/:id(.:format)' => 'feed#show'
# nest feeds into channels
resources :channels do
resources :feed
resources :api_keys
resources :status
resources :charts
end
match 'login' => 'user_sessions#new', :as => :login
match 'logout' => 'user_sessions#destroy', :as => :logout
match 'users/reset_password', :to => 'users#reset_password', :as => 'reset_password'
match 'forgot_password', :to => 'users#forgot_password', :as => 'forgot_password'
match ':controller(/:action(/:id(.:format)))'
end