The Open Brewery DB API server is a Ruby on Rails API app connected to a PostgreSQL DB server.
Related project: Open Brewery DB
This is the code for the Open Brewery DB API server.
- Ruby 2.6.5
- PostgreSQL 9.4
- Elastic Search (See Searchkick's Getting Started section.)
- Clone the repo
$ git clone https://github.com/chrisjm/openbrewerydb-rest-api
- Run
bundle install
- Run
bundle exec rails db:setup
- Run
bundle exec rails s
- The server will be running at
http://localhost:3000
Note: There is no front-end for the API at this time.
There are some assumptions for the local PostgreSQL service configuration.
- Host is
localhost
or127.0.0.1
- User is blank (i.e. it is the current system user)
- Password is blank
All of these settings can be overwritten by setting environment variables in .env
:
POSTGRES_USER
POSTGRES_PASSWORD
POSTGRES_HOST
See config/database.yml
for configuration.
Included in the repo at lib/import/brewers_association/
is scraped HTML from the Brewer's Association. This will be replaced soon with a full compressed SQL which will be easier
bundle exec rake breweries:import:brewers_association
bundle exec rake
or bundle exec rspec