diff --git a/.ci/.gitlab-ci.yml b/.ci/.gitlab-ci.yml deleted file mode 100644 index 591736b..0000000 --- a/.ci/.gitlab-ci.yml +++ /dev/null @@ -1,58 +0,0 @@ -image: ruby:2.4.0 - -before_script: - - > - : "${HEROKU_EMAIL:?Please set HEROKU_EMAIL in your CI/CD config vars}" - - > - : "${HEROKU_AUTH_TOKEN:?Please set HEROKU_AUTH_TOKEN in your CI/CD config vars}" - - curl https://cli-assets.heroku.com/install-standalone.sh | sh - - | - cat >~/.netrc < 1.3' -gem 'hanami-model', '~> 1.3' +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') + "https://github.com/#{repo_name}.git" +end + +ruby '~> 2.6.3' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.0.7', '>= 5.0.7.2' + +# Ruby interface to the PostgreSQL RDBMS. gem 'pg' -group :development do - # Code reloading - # See: http://hanamirb.org/guides/projects/code-reloading - gem 'shotgun', platforms: :ruby - gem 'hanami-webconsole' -end +# Use sqlite3 as the database for Active Record +gem 'sqlite3' -group :test, :development do - gem 'dotenv', '~> 2.4' -end +# Use Puma as the app server +gem 'puma', '~> 3.0' + +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +# gem 'jbuilder', '~> 2.5' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' -group :test do - gem 'rspec' - gem 'capybara' +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development + +# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible +# gem 'rack-cors' + +group :development, :test do + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platform: :mri end -group :production do - gem 'puma' +group :development do + gem 'listen', '~> 3.0.5' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'rufo', '~> 0.7.0', require: false + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' + # A Ruby static code analyzer + gem 'rubocop', '~> 0.70.0', require: false + gem 'rubocop-rails', require: false + # Code smell detector for Ruby + gem 'reek' + + # A code metric tool for rails projects + gem 'rails_best_practices' + + # A static analysis security vulnerability scanner for Ruby on Rails applications + gem 'brakeman', require: false + + # Annotate Rails classes with schema and routes info + gem 'annotate' end + +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] diff --git a/Gemfile.lock b/Gemfile.lock index d61ec48..94fb9b3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,191 +1,206 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - better_errors (2.5.0) - coderay (>= 1.0.0) - erubi (>= 1.0.0) - rack (>= 0.9.0) - binding_of_caller (0.8.0) - debug_inspector (>= 0.0.1) - capybara (3.12.0) - addressable - mini_mime (>= 0.1.3) - nokogiri (~> 1.8) - rack (>= 1.6.0) - rack-test (>= 0.6.3) - regexp_parser (~> 1.2) - xpath (~> 3.2) - coderay (1.1.2) - concurrent-ruby (1.1.3) - debug_inspector (0.0.3) - diff-lcs (1.3) - dotenv (2.5.0) - dry-configurable (0.7.0) - concurrent-ruby (~> 1.0) - dry-container (0.6.0) - concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (0.4.7) - concurrent-ruby (~> 1.0) - dry-equalizer (0.2.1) - dry-initializer (1.4.1) - dry-logic (0.4.2) - dry-container (~> 0.2, >= 0.2.6) - dry-core (~> 0.2) - dry-equalizer (~> 0.2) - dry-struct (0.3.1) - dry-configurable (~> 0.1) - dry-core (~> 0.3) - dry-equalizer (~> 0.2) - dry-types (~> 0.9, >= 0.9.0) - ice_nine (~> 0.11) - dry-types (0.11.1) - concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1) - dry-container (~> 0.3) - dry-core (~> 0.2, >= 0.2.1) - dry-equalizer (~> 0.2) - dry-logic (~> 0.4, >= 0.4.0) - inflecto (~> 0.0.0, >= 0.0.2) - dry-validation (0.11.0) - concurrent-ruby (~> 1.0) - dry-configurable (~> 0.1, >= 0.1.3) - dry-core (~> 0.2, >= 0.2.1) - dry-equalizer (~> 0.2) - dry-logic (~> 0.4, >= 0.4.0) - dry-types (~> 0.11.0) - erubi (1.7.1) - hanami (1.3.0) - bundler - concurrent-ruby (~> 1.0) - hanami-assets (~> 1.3) - hanami-cli (~> 0.3) - hanami-controller (~> 1.3) - hanami-helpers (~> 1.3) - hanami-mailer (~> 1.3) - hanami-router (~> 1.3) - hanami-utils (~> 1.3) - hanami-validations (~> 1.3) - hanami-view (~> 1.3) - hanami-assets (1.3.0) - hanami-helpers (~> 1.3) - hanami-utils (~> 1.3) - tilt (~> 2.0, >= 2.0.2) - hanami-cli (0.3.0) - concurrent-ruby (~> 1.0) - hanami-utils (~> 1.3) - hanami-controller (1.3.0) - hanami-utils (~> 1.3) - rack (~> 2.0) - hanami-helpers (1.3.0) - hanami-utils (~> 1.3) - hanami-mailer (1.3.0) - hanami-utils (~> 1.3) - mail (~> 2.6) - tilt (~> 2.0, >= 2.0.1) - hanami-model (1.3.0) - concurrent-ruby (~> 1.0) - dry-types (~> 0.11.0) - hanami-utils (~> 1.3) - rom (~> 3.3, >= 3.3.3) - rom-repository (~> 1.4) - rom-sql (~> 1.3, >= 1.3.5) - hanami-router (1.3.0) - hanami-utils (~> 1.3) - http_router (= 0.11.2) + actioncable (5.0.7.2) + actionpack (= 5.0.7.2) + nio4r (>= 1.2, < 3.0) + websocket-driver (~> 0.6.1) + actionmailer (5.0.7.2) + actionpack (= 5.0.7.2) + actionview (= 5.0.7.2) + activejob (= 5.0.7.2) + mail (~> 2.5, >= 2.5.4) + rails-dom-testing (~> 2.0) + actionpack (5.0.7.2) + actionview (= 5.0.7.2) + activesupport (= 5.0.7.2) rack (~> 2.0) - hanami-utils (1.3.0) + rack-test (~> 0.6.3) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.2) + actionview (5.0.7.2) + activesupport (= 5.0.7.2) + builder (~> 3.1) + erubis (~> 2.7.0) + rails-dom-testing (~> 2.0) + rails-html-sanitizer (~> 1.0, >= 1.0.3) + activejob (5.0.7.2) + activesupport (= 5.0.7.2) + globalid (>= 0.3.6) + activemodel (5.0.7.2) + activesupport (= 5.0.7.2) + activerecord (5.0.7.2) + activemodel (= 5.0.7.2) + activesupport (= 5.0.7.2) + arel (~> 7.0) + activesupport (5.0.7.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + annotate (3.0.3) + activerecord (>= 3.2, < 7.0) + rake (>= 10.4, < 14.0) + arel (7.1.4) + ast (2.4.0) + axiom-types (0.1.1) + descendants_tracker (~> 0.0.4) + ice_nine (~> 0.11.0) + thread_safe (~> 0.3, >= 0.3.1) + brakeman (4.7.2) + builder (3.2.3) + byebug (11.0.1) + code_analyzer (0.4.8) + sexp_processor + codeclimate-engine-rb (0.4.1) + virtus (~> 1.0) + coercible (1.0.0) + descendants_tracker (~> 0.0.1) + concurrent-ruby (1.1.5) + crass (1.0.5) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + equalizer (0.0.11) + erubis (2.7.0) + ffi (1.11.3) + globalid (0.4.2) + activesupport (>= 4.2.0) + i18n (1.7.0) concurrent-ruby (~> 1.0) - transproc (~> 1.0) - hanami-validations (1.3.0) - dry-validation (~> 0.11, < 0.12) - hanami-utils (~> 1.3) - hanami-view (1.3.0) - hanami-utils (~> 1.3) - tilt (~> 2.0, >= 2.0.1) - hanami-webconsole (0.1.0) - better_errors (~> 2.4) - binding_of_caller (~> 0.8) - http_router (0.11.2) - rack (>= 1.0.0) - url_mount (~> 0.2.1) ice_nine (0.11.2) - inflecto (0.0.2) + jaro_winkler (1.5.4) + json (2.2.0) + kwalify (0.7.2) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + loofah (2.4.0) + crass (~> 1.0.2) + nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) - mini_mime (1.0.1) - mini_portile2 (2.3.0) - nokogiri (1.8.5) - mini_portile2 (~> 2.3.0) - pg (1.1.3) - public_suffix (3.0.3) - puma (3.12.0) - rack (2.0.6) - rack-test (1.1.0) - rack (>= 1.0, < 3) - rake (12.3.1) - regexp_parser (1.3.0) - rom (3.3.3) - concurrent-ruby (~> 1.0) - dry-core (~> 0.3) - dry-equalizer (~> 0.2) - dry-initializer (~> 1.3) - dry-types (~> 0.9, >= 0.9.4) - rom-mapper (~> 0.5, >= 0.5.1) - rom-mapper (0.5.1) - dry-core (~> 0.2, >= 0.2.3) - dry-equalizer (~> 0.2) - transproc (~> 1.0) - rom-repository (1.4.0) - dry-core (~> 0.3, >= 0.3.1) - dry-struct (~> 0.3) - rom (~> 3.3) - rom-mapper (~> 0.5) - rom-sql (1.3.5) - dry-core (~> 0.3) - dry-equalizer (~> 0.2) - dry-types (~> 0.11.0) - rom (~> 3.2, >= 3.2.2) - sequel (~> 4.43) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - sequel (4.49.0) - shotgun (0.9.2) + method_source (0.9.2) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.13.0) + nio4r (2.5.2) + nokogiri (1.10.5) + mini_portile2 (~> 2.4.0) + parallel (1.19.1) + parser (2.6.5.0) + ast (~> 2.4.0) + pg (1.1.4) + psych (3.1.0) + puma (3.12.1) + rack (2.0.7) + rack-test (0.6.3) rack (>= 1.0) - tilt (2.0.9) - transproc (1.0.2) - url_mount (0.2.1) - rack - xpath (3.2.0) - nokogiri (~> 1.8) + rails (5.0.7.2) + actioncable (= 5.0.7.2) + actionmailer (= 5.0.7.2) + actionpack (= 5.0.7.2) + actionview (= 5.0.7.2) + activejob (= 5.0.7.2) + activemodel (= 5.0.7.2) + activerecord (= 5.0.7.2) + activesupport (= 5.0.7.2) + bundler (>= 1.3.0) + railties (= 5.0.7.2) + sprockets-rails (>= 2.0.0) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + rails_best_practices (1.19.4) + activesupport + code_analyzer (>= 0.4.8) + erubis + i18n + json + require_all (~> 2.0) + ruby-progressbar + railties (5.0.7.2) + actionpack (= 5.0.7.2) + activesupport (= 5.0.7.2) + method_source + rake (>= 0.8.7) + thor (>= 0.18.1, < 2.0) + rainbow (3.0.0) + rake (13.0.1) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) + reek (5.5.0) + codeclimate-engine-rb (~> 0.4.0) + kwalify (~> 0.7.0) + parser (>= 2.5.0.0, < 2.7, != 2.5.1.1) + psych (~> 3.1.0) + rainbow (>= 2.0, < 4.0) + require_all (2.0.0) + rubocop (0.70.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.6) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.7) + rubocop-rails (2.0.1) + rack (>= 1.1) + rubocop (>= 0.70.0) + ruby-progressbar (1.10.1) + rufo (0.7.0) + sexp_processor (4.13.0) + spring (2.0.2) + activesupport (>= 4.2) + spring-watcher-listen (2.0.1) + listen (>= 2.7, < 4.0) + spring (>= 1.2, < 3.0) + sprockets (3.7.2) + concurrent-ruby (~> 1.0) + rack (> 1, < 3) + sprockets-rails (3.2.1) + actionpack (>= 4.0) + activesupport (>= 4.0) + sprockets (>= 3.0.0) + sqlite3 (1.4.1) + thor (0.20.3) + thread_safe (0.3.6) + tzinfo (1.2.5) + thread_safe (~> 0.1) + unicode-display_width (1.6.0) + virtus (1.0.5) + axiom-types (~> 0.1) + coercible (~> 1.0) + descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) + websocket-driver (0.6.5) + websocket-extensions (>= 0.1.0) + websocket-extensions (0.1.4) PLATFORMS ruby DEPENDENCIES - capybara - dotenv (~> 2.4) - hanami (~> 1.3) - hanami-model (~> 1.3) - hanami-webconsole + annotate + brakeman + byebug + listen (~> 3.0.5) pg - puma - rake - rspec - shotgun + puma (~> 3.0) + rails (~> 5.0.7, >= 5.0.7.2) + rails_best_practices + reek + rubocop (~> 0.70.0) + rubocop-rails + rufo (~> 0.7.0) + spring + spring-watcher-listen (~> 2.0.0) + sqlite3 + tzinfo-data + +RUBY VERSION + ruby 2.6.3p62 BUNDLED WITH - 1.15.4 + 1.17.3 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..0719848 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: bin/rails s -p 5000 diff --git a/Procfile.dev b/Procfile.dev new file mode 100644 index 0000000..0719848 --- /dev/null +++ b/Procfile.dev @@ -0,0 +1 @@ +web: bin/rails s -p 5000 diff --git a/README.md b/README.md index be30d3d..80c74ff 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,81 @@ # Flick -Flick is a fullstack development platform to generate, develop and deploy web applications and microservices. +Rails Versioned API starter template for hipsters! * Version 0.0.1 ## Table of Contents * [Prerequisites](#prerequisites) -* [Setup](#setup) -* [Resources](#resources) -* [Deployment](#deployment) -* [Docker](#docker) -* [Test API with Postman](#test-api-with-postman) +* [Project Setup](#project-setup) +* [Development](#development) +* [Tools](#tools) ## Prerequisites * [Ruby](https://www.ruby-lang.org/en/downloads/) -* [Hanami](https://guides.hanamirb.org/introduction/getting-started/) +* [Ruby on Rails](http://guides.rubyonrails.org/getting_started.html) * [RVM](https://rvm.io/) -* [PostgreSQL](https://www.postgresql.org/docs/) +* [PostgreSQL DB](https://www.postgresql.org/docs/) -## Setup +## Project Setup -How to run tests: +* For production, you need to replace the asterisk with the URL of your client-side application in ./config/initializers/cors.rb file. + +1. Clone or download this repo +2. Run `bundle install` +3. Run `rake db:create` +4. Run `bin/rails db:migrate RAILS_ENV=development` +5. Run `bin/rails db:seed RAILS_ENV=development` +6. Run `brew install overmind` (for MacOS users) +7. Run `overmind start` +8. Visit --> [http://localhost:5000/](http://localhost:5000/). That's it!. + +## Tools + +* Run `rubocop` for Ruby lint. +* Run `rubocop -a` for fixed some issues automatically. +* Run `reek .` for analyzing code. +* Run `brakeman` for static analysis and for security vulnerabilities. +* Run `rails_best_practices .` in root app directory. Helps to find unused methods, missing indexes into database tables and many other things. + +### Annotate (aka AnnotateModels) usage + +To annotate all your models, tests, fixtures, and factories: ```bash -% bundle exec rake +cd /path/to/app +annotate ``` -How to run the development console: +To annotate just your models, tests, and factories: ```bash -% bundle exec hanami console +annotate --exclude fixtures ``` -How to run the development server: +To annotate just your models: ```bash -% bundle exec hanami server +annotate --exclude tests,fixtures,factories,serializers ``` -How to prepare (create and migrate) DB for `development` and `test` environments: +To annotate routes.rb: ```bash -% bundle exec hanami db prepare - -% HANAMI_ENV=test bundle exec hanami db prepare +annotate --routes ``` -## Resources +To remove model/test/fixture/factory/serializer annotations: -Explore Hanami [guides](http://hanamirb.org/guides/), [API docs](http://docs.hanamirb.org/1.3.0/), or jump in [chat](http://chat.hanamirb.org) for help. Enjoy! 🌸 +```bash +annotate --delete +``` + +To remove routes.rb annotations: -## Deployment +```bash +annotate --routes --delete +``` -* Mainly for Heroku hosting. -* See [documentation](./DEPLOYMENT.md). +To automatically annotate every time you run db:migrate, either run rails g annotate:install or add Annotate.load_tasks to your `Rakefile`. See the configuration in Rails section for more info. diff --git a/Rakefile b/Rakefile index 5000dfa..e85f913 100644 --- a/Rakefile +++ b/Rakefile @@ -1,9 +1,6 @@ -require 'rake' -require 'hanami/rake_tasks' +# Add your own tasks in files placed in lib/tasks ending in .rake, +# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -begin - require 'rspec/core/rake_task' - RSpec::Core::RakeTask.new(:spec) - task default: :spec -rescue LoadError -end +require_relative 'config/application' + +Rails.application.load_tasks diff --git a/app/channels/application_cable/channel.rb b/app/channels/application_cable/channel.rb new file mode 100644 index 0000000..d672697 --- /dev/null +++ b/app/channels/application_cable/channel.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Channel < ActionCable::Channel::Base + end +end diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb new file mode 100644 index 0000000..0ff5442 --- /dev/null +++ b/app/channels/application_cable/connection.rb @@ -0,0 +1,4 @@ +module ApplicationCable + class Connection < ActionCable::Connection::Base + end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..4ac8823 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,2 @@ +class ApplicationController < ActionController::API +end diff --git a/apps/web/assets/images/.gitkeep b/app/controllers/concerns/.keep similarity index 100% rename from apps/web/assets/images/.gitkeep rename to app/controllers/concerns/.keep diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb new file mode 100644 index 0000000..a009ace --- /dev/null +++ b/app/jobs/application_job.rb @@ -0,0 +1,2 @@ +class ApplicationJob < ActiveJob::Base +end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb new file mode 100644 index 0000000..286b223 --- /dev/null +++ b/app/mailers/application_mailer.rb @@ -0,0 +1,4 @@ +class ApplicationMailer < ActionMailer::Base + default from: 'from@example.com' + layout 'mailer' +end diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 0000000..10a4cba --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/apps/web/assets/javascripts/.gitkeep b/app/models/concerns/.keep similarity index 100% rename from apps/web/assets/javascripts/.gitkeep rename to app/models/concerns/.keep diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb new file mode 100644 index 0000000..cbd34d2 --- /dev/null +++ b/app/views/layouts/mailer.html.erb @@ -0,0 +1,13 @@ + + + + + + + + + <%= yield %> + + diff --git a/app/views/layouts/mailer.text.erb b/app/views/layouts/mailer.text.erb new file mode 100644 index 0000000..37f0bdd --- /dev/null +++ b/app/views/layouts/mailer.text.erb @@ -0,0 +1 @@ +<%= yield %> diff --git a/apps/web/application.rb b/apps/web/application.rb deleted file mode 100644 index 9793db2..0000000 --- a/apps/web/application.rb +++ /dev/null @@ -1,326 +0,0 @@ -require 'hanami/helpers' -require 'hanami/assets' - -module Web - class Application < Hanami::Application - configure do - ## - # BASIC - # - - # Define the root path of this application. - # All paths specified in this configuration are relative to path below. - # - root __dir__ - - # Relative load paths where this application will recursively load the - # code. - # - # When you add new directories, remember to add them here. - # - load_paths << [ - 'controllers', - 'views' - ] - - # Handle exceptions with HTTP statuses (true) or don't catch them (false). - # Defaults to true. - # See: http://www.rubydoc.info/gems/hanami-controller/#Exceptions_management - # - # handle_exceptions true - - ## - # HTTP - # - - # Routes definitions for this application - # See: http://www.rubydoc.info/gems/hanami-router#Usage - # - routes 'config/routes' - - # URI scheme used by the routing system to generate absolute URLs - # Defaults to "http" - # - # scheme 'https' - - # URI host used by the routing system to generate absolute URLs - # Defaults to "localhost" - # - # host 'example.org' - - # URI port used by the routing system to generate absolute URLs - # Argument: An object coercible to integer, defaults to 80 if the scheme - # is http and 443 if it's https - # - # This should only be configured if app listens to non-standard ports - # - # port 443 - - # Enable cookies - # Argument: boolean to toggle the feature - # A Hash with options - # - # Options: - # :domain - The domain (String - nil by default, not required) - # :path - Restrict cookies to a relative URI - # (String - nil by default) - # :max_age - Cookies expiration expressed in seconds - # (Integer - nil by default) - # :secure - Restrict cookies to secure connections - # (Boolean - Automatically true when using HTTPS) - # See #scheme and #ssl? - # :httponly - Prevent JavaScript access (Boolean - true by default) - # - # cookies true - # or - # cookies max_age: 300 - - # Enable sessions - # Argument: Symbol the Rack session adapter - # A Hash with options - # - # See: http://www.rubydoc.info/gems/rack/Rack/Session/Cookie - # - # sessions :cookie, secret: ENV['WEB_SESSIONS_SECRET'] - - # Configure Rack middleware for this application - # - # middleware.use Rack::Protection - - # Default format for the requests that don't specify an HTTP_ACCEPT header - # Argument: A symbol representation of a mime type, defaults to :html - # - # default_request_format :html - - # Default format for responses that don't consider the request format - # Argument: A symbol representation of a mime type, defaults to :html - # - # default_response_format :html - - # HTTP Body parsers - # Parse non GET responses body for a specific mime type - # Argument: Symbol, which represent the format of the mime type - # (only `:json` is supported) - # Object, the parser - # - # body_parsers :json - - # When it's true and the router receives a non-encrypted request (http), - # it redirects to the secure equivalent (https). Disabled by default. - # - # force_ssl true - - ## - # TEMPLATES - # - - # The layout to be used by all views - # - layout :application # It will load Web::Views::ApplicationLayout - - # The relative path to templates - # - templates 'templates' - - ## - # ASSETS - # - assets do - # JavaScript compressor - # - # Supported engines: - # - # * :builtin - # * :uglifier - # * :yui - # * :closure - # - # See: http://hanamirb.org/guides/assets/compressors - # - # In order to skip JavaScript compression comment the following line - javascript_compressor :builtin - - # Stylesheet compressor - # - # Supported engines: - # - # * :builtin - # * :yui - # * :sass - # - # See: http://hanamirb.org/guides/assets/compressors - # - # In order to skip stylesheet compression comment the following line - stylesheet_compressor :sass - - # Specify sources for assets - # - sources << [ - 'assets' - ] - end - - ## - # SECURITY - # - - # X-Frame-Options is a HTTP header supported by modern browsers. - # It determines if a web page can or cannot be included via and - #