Sha256: 1f6672fac16486f0c948740485811d2134b047b71cdd76bc0d3e8061d208e034

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true
require 'rails/engine'

module Apress
  module Api
    class Engine < Rails::Engine
      config.autoload_paths << config.root.join("lib")
      config.paths.add 'app/docs', eager_load: false

      Apress::Documentation.add_load_path(config.root.join('app/docs'))

      config.api = {
        secret_token_ttl: 1.hour,
        refresh_token_ttl: 1.week,
        v1_doc_path: 'docs/swagger/v1.json',
        version: '1.0.0',
        title: 'Apress API',
        description: 'Apress API',
        terms_of_service: 'None',
        contact_name: 'Abak-Press Team',
        base_path: '/api/v1'
      }

      initializer "apress-api", before: :load_init_rb do |app|
        app.config.paths["db/migrate"].concat(config.paths["db/migrate"].expanded)

        ::MultiJson.use :oj

        require 'jbuilder/jbuilder_template'
        JbuilderTemplate.send :include, Apress::Api::Extensions::Jbuilder::JbuilderTemplate
      end

      initializer "apress-api-factories", after: "factory_girl.set_factory_paths" do
        if defined?(FactoryGirl)
          FactoryGirl.definition_file_paths.unshift root.join("spec", "factories")
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apress-api-1.24.2 lib/apress/api/engine.rb