diff --git a/README.md b/README.md index ad94d15..e7909d0 100644 --- a/README.md +++ b/README.md @@ -33,11 +33,13 @@ There is a `rails_upgrade` branch where some of this work has been started and p 4. Create database.yml in the config folder. You can `cp config/database.example.yml config/database.yml` to get a starting point. -5. Setup the database (create DB, load schema, load seed data) +5. Create the `.env` file. You can `cp sample.env .env` to get a starting point. + +6. Setup the database (create DB, load schema, load seed data) `rake db:setup` -6. Start the app +7. Start the app `foreman start` diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 79b1f7e..53a6d2b 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -7,8 +7,5 @@ # Set the session secret as an environment variable. # Generate a new secret with `rake secret` -if ENV["SECRET_TOKEN"] - SplendidBacon::Application.config.secret_token = ENV["SECRET_TOKEN"] -else - raise "You must set the SECRET_TOKEN environment variable!" -end + +SplendidBacon::Application.config.secret_token = ENV["SECRET_TOKEN"] diff --git a/sample.env b/sample.env index 29709a9..6376675 100644 --- a/sample.env +++ b/sample.env @@ -1,2 +1,3 @@ +RACK_ENV=development SECRET_TOKEN=fd739b6b4445a829c21ad88a33cea6e327676bd8d345697e2ea3339531210b1971d2cf41362eec4471f78483ea6f5dfe3c84c73b3d3b75bff8daf3155f02a0b3 -HOST=example.herokuapp.com +HOST=localhost:5000 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd9ef7e..d0219e8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,6 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' ENV["RAILS_ENV"] ||= 'test' +ENV["SECRET_TOKEN"] ||= "ThisIsAReallyBadSecretBecauseItIsHardCoded45697e2ea3339531210b1971d2cf41362eec4471f78483ea6f5dfe3c84c73b3d3b75bff8daf3155f02a0b3" require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails'