Sha256: bf67d062dd271d71a17fc2a60e60ebe8b0193b57dfaec563d9ddca6261bf1b4d
Contents?: true
Size: 857 Bytes
Versions: 2
Compression:
Stored size: 857 Bytes
Contents
# bundle exec ruby examples/renderer.rb require_relative "../lib/storyblok" require "redis" logger = Logger.new(STDOUT) redis = Redis.new(url: "redis://localhost:6379") cache = Storyblok::Cache::Redis.new(redis: redis) client = Storyblok::Client.new( token: "6HMYdAjBoONyuS6GIf5PdAtt", logger: logger, component_resolver: ->(component, data) { "Placeholder for #{component}: #{data['text']}" }, api_url: "api-testing.storyblok.com", api_version: 2, cache: cache ) res = client.flush res = client.story("authors/page", { version: "published" }) puts client.cache_version res = client.story("authors/page", { version: "published" }) res = client.story("authors/page", { version: "published" }) res = client.story("authors/page", { version: "published" }) puts res["data"] # puts client.render(res['data']['story']['content']['intro'])
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
storyblok-3.2.0 | examples/renderer.rb |
storyblok-3.1.0 | examples/renderer.rb |