Sha256: 6768a1a5629e67d3a9540dddd7fed3adfa779c08b912a7dd4ea0ea1f8be75625

Contents?: true

Size: 453 Bytes

Versions: 100

Compression:

Stored size: 453 Bytes

Contents

require 'rubypitaya/core/http_routes'

RubyPitaya::HttpRoutes.class_eval do

    get '/hello-world/html' do
      content_type 'text/html'

      @message = "Hello World"

      erb :hello_world
    end

    get '/hello-world/json' do
      response = {
        message: 'Hello World!'
      }.to_json
    end

  private

  def response_error(message)
    response = {
      code: StatusCodes::CODE_ERROR,
      message: message,
    }.to_json
  end
end

Version data entries

100 entries across 96 versions & 1 rubygems

Version Path
rubypitaya-3.19.6 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.5 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.4 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.3 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.2 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.1 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.19.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.18.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.17.2 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.17.1 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.17.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.16.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.15.3 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.15.2 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.15.1 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.15.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.14.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.13.1 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.13.0 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/app/http/hello_world_http.rb