<commit_before>require 'rubygems'
require 'sinatra' 
require 'json'

get '/' do
  "It runs from Heroku!"
end

get '/messages/next' do
	return {:message => "A message!"}.to_json
end

# API sends 'message' as :
	# message_id
	# text
	# delay (of current message)
	# children (message_id, choice)

# when a client app opens a "game scenario" for the first time
get '/scenarios/:unique_scenario_id/messages' do
	# get from request body 'first_time' (boolean)

 	# if user's first time 
 		# create a new record (table) for this particular scenario
 		# insert scenario's first message into the table
 		# return first message 
 	# elsif user already played scenario
 		# return the message log and next message
 	# end
end

post '/scenarios/:unique_scenario_id/messages/:message_id/choices/:choice_id' do

	# update the user's scenario log in table

	# return next message

end<commit_msg>Clarify mobile client API routes<commit_after>require 'rubygems'
require 'sinatra' 
require 'json'

get '/' do
  "It runs from Heroku!"
end

### MOBILE CLIENT API

# API sends 'message' as :
	# message_id
	# text
	# delay (of current message)
	# children (message_id, choice)

# ALL routes below require a user token parameter (so linked to an account)

get '/scenarios' do
	# return all_available_scenario_ids
end

get '/scenarios/:unique_scenario_id' do
	# return scenario specific information
end

# only called by the client when first time opening a scenario
get '/scenarios/:unique_scenario_id/messages' do
	# if a user already has a log
		# return all messages

	# else 
		# create a new empty store 
		# return first message(s)
end

put '/messages/:message_id/choices/:choice_id' do
	# REQUIRES
		# a paramater corresponding to a scenario id

	# update the store

	# returns the next message(s)
end
{'fraction_non_alphanumeric': 0.08486878838637632, 'fraction_numerical': 0.0, 'mean_word_length': 4.019607843137255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '426559', 'n_tokens_mistral': 589, 'n_tokens_neox': 571, 'n_words': 218}