lib/soaspec/generator/lib/new_rest_service.rb.erb in soaspec-0.2.18 vs lib/soaspec/generator/lib/new_rest_service.rb.erb in soaspec-0.2.19
- old
+ new
@@ -1,12 +1,14 @@
# This class represent REST Api calls for the <%= @name %> API
class <%= @name %> < Soaspec::RestHandler
## Defining request
- # All requests to <%= @name %> will start with this url
+ # All requests to <%= @name %> will start with this url <% if @base_url %>
+ base_url '<%= @base_url %>'
+ <% else %>
# TODO: Change this mandatory base_url to the url that all requests to this service start with
# base_url "https://my_host/api/<%= ENV['environment'] %>/api_name" # ERB can be used to make this dynamic based on environment
-
+ <% end %>
# Headers that will be sent by default using this Handler
# If symbol is used, they'll be converted to standard HTTP headers
# headers accept: 'application/json', content_type: 'application/json'
# Filename of oauth2 file to use for oauth2 parameters. 'Soaspec.credentials_folder' can be set to globally defined a folder with credentials
\ No newline at end of file