marvelapi

ref: master

./main.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require File.join(File.dirname(__FILE__), 'config', 'boot')

module App
  class Api < Sinatra::Base

    error do
      $stderr.puts "Hm, there was a error - #{request.env['sinatra.error'].inspect}"
    end

    get "/" do
      # Silk Character ID
      silk_id = 1017815
      story_id = 202161

      client = Marvel::Client.new
      @story = client.story(story_id)
      @characters = client.characters_from_story(story_id)

      erb :index
    end
  end
end