<commit_before>require 'sinatra'
require 'sinatra/export'

require 'net/http'
require 'json'

response = Net::HTTP.get('localhost', '/pages/1/preview.json', '3000')
data = JSON.parse(response)

get '/' do
  erb :home
end<commit_msg>passes api response to home view<commit_after>require 'sinatra'
require 'sinatra/export'

require 'net/http'
require 'json'

response = Net::HTTP.get('localhost', '/pages/1/preview.json', '3000')
data = JSON.parse(response)

get '/' do
  @solution  = data['solution']
  @resources = data['resources']
  @scenarios = data['scenarios']
  @products  = data['products']

  erb :home
end
{'fraction_non_alphanumeric': 0.16612377850162866, 'fraction_numerical': 0.016286644951140065, 'mean_word_length': 5.212121212121212, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5223655', 'n_tokens_mistral': 220, 'n_tokens_neox': 210, 'n_words': 50}