<commit_before>require "dotenv"
Dotenv.load

require "sinatra"
require "mongo"
require "json"

db = Mongo::Client.new([ENV["MONGODB_HOST"]], database: ENV["MONGODB_DB"])

get "/" do
  "Hello, world!"
end

get "/pois" do
  pois = []
  db[:pois].find.each do |poi|
    pois << poi
  end
  pois.to_json
end
<commit_msg>Add post for pois<commit_after>require "dotenv"
Dotenv.load

require "sinatra"
require "mongo"
require "json"

db = Mongo::Client.new([ENV["MONGODB_HOST"]], database: ENV["MONGODB_DB"])

get "/" do
  "Hello, world!"
end

get "/pois" do
  pois = []
  db[:pois].find.each do |poi|
    pois << poi
  end
  pois.to_json
end

post "/pois" do
  # db[:pois].insert_one(
  json = JSON.parse(request.body.string)
  json["test"]
end

{'fraction_non_alphanumeric': 0.16914749661705006, 'fraction_numerical': 0.0, 'mean_word_length': 4.068493150684931, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6895800', 'n_tokens_mistral': 313, 'n_tokens_neox': 312, 'n_words': 71}