Skip to content

A Rack app that responds to queries containing a country code with a list of subdivisions/states

License

Notifications You must be signed in to change notification settings

maxio-com/subdivision_responder

Repository files navigation

Subdivision Responder

A simple Rack app that responds with subdivisions (states and provinces) when queried with an alpha2 country code.

% curl http://example.com/subdivisions\?country_code\=US
{"US":[["Alaska","AK"],["Alabama","AL"],...]}

Installation for use in a Rails app

In your Gemfile:

gem 'subdivision_responder'

In your config/routes.rb:

mount SubdivisionResponder::RackApp.new => '/subdivisions'

Data

All country and subdivision data is sourced from the countries gem

Copyright

MIT Licensed

Copyright (c) 2013 Michael Klett / Chargify

See LICENSE.txt for further details.

About

A Rack app that responds to queries containing a country code with a list of subdivisions/states

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages