7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/generators/cxf_files_generator.rb', line 7
def create_cxf_files
copy_file 'cxf_config.yml.erb', 'cxf_config.yml.erb'
copy_file 'cxf_user_controller.rb', './app/controllers/api/cxf_user_controller.rb'
copy_file 'cxf_contact_controller.rb', './app/controllers/api/v1/cxf_contact_controller.rb'
copy_file 'cxf_public_controller.rb', './app/controllers/api/v1/cxf_public_controller.rb'
copy_file 'cxf_assets_controller.rb', './app/controllers/cxf_assets_controller.rb'
route " # Cxf auto-generated routes (proxy to send request to cxf.cloud)\n match '/public-assets/*path' => 'cxf_assets#index', via: [:get, :post, :put, :patch, :delete]\n namespace :api, defaults: { format: :json } do\n match '/v1/*path' => 'cxf_user#index', via: [:get, :post, :put, :patch, :delete]\n match '/user/v1/*path' => 'cxf_user#index', via: [:get, :post, :put, :patch, :delete]\n match '/contact/v1/*path' => 'cxf_contact#index', via: [:get, :post, :put, :patch, :delete] \n namespace :v1 do \n match '/contacts/*path' => 'cxf_contact#index', via: [:get, :post, :put, :patch, :delete] \n match '/*path' => 'cxf_public#index', via: [:get, :post, :put, :patch, :delete]\n end\n end\n eos\nend\n"
|