<commit_before>get '/' do
  erb :index
end


# TODO: convert this route to use AJAX
post '/rolls' do
  @die = Die.new(params[:sides].to_i)

  erb :index  # HINT: what does this do? what should we do instead?
end<commit_msg>update ajax-request controller to make an AJAX request<commit_after>get '/' do
  @die = Die.new(0)	
  erb :index
end

post '/rolls' do
  @die = Die.new(params[:sides].to_i)
  #post request
  if request.xhr?
    content_type :json
    {value: @die.roll}.to_json
  else
    erb :index
  end
end  
{'fraction_non_alphanumeric': 0.11992263056092843, 'fraction_numerical': 0.0019342359767891683, 'mean_word_length': 3.28099173553719, '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': '2261225', 'n_tokens_mistral': 203, 'n_tokens_neox': 197, 'n_words': 61}