sinatra + heroku + postgres

Now that the (read-only) web service was working locally on my machine, I wanted to see if I could push it to Heroku. The first thing I did was to dump my Postgres database. Since the basic/free Heroku account only supports databases with at most 10k rows, I truncated the zip code database. There are a total of 42k+ rows, so chomping off this many rows is significant, but I'm mostly doing this just as a demonstration. Usually, you'd run pg_dump to export an entire Postgres database to a file. However, pg_dump is…Read more …

getting started with sinatra and postgres web service

I'm in the process of resurrecting some of my past projects. One of themĀ is a web service that provided details for a given zip code. For example, you could lookup the zip code '15213' and the web service would spit out the geographical center for the zip code (i.e., the latitude and longitude coordinates), as well as the city and state for that zip. I originally programmed the web service using Ruby on Rails, but using RoR for a relatively simple API is a bit overkill. So I decided to use this project…Read more …