-
-
Save sixtyfive/3fe57ddb33ea57c79b96402e60e5dc60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding : utf-8 -*- | |
Encoding.default_external = 'utf-8' # why did a Ruby programmer in 2022 feel these to be necessary? | |
require "multi_json" | |
require "sinatra" | |
require "sinatra-contrib", require: "sinatra/multi_route" | |
require "puma" | |
require "lock_jar" | |
LockJar.register_jarfile "Jarfile" | |
LockJar.lock # haha... | |
LockJar.load # haaa... | |
STORE = Java::OrgH2Mvstore::MVstore::Builder.new.file_name("data.db").compress.open | |
MAP = STORE.open_map "data" # MAP.class => Java::OrgH2Mvstore::MVMap; '"OrgH2Mvstore" "MVMap"' is ungooglable though... | |
# but it seems to be this: https://www.h2database.com/html/mvstore.html | |
class Server < Sinatra::Base | |
register Sinatra::MultiRoute | |
# ... | |
route :get, :post, "/all" do | |
MultiJson.dump entries:MAP.to_a # where does entries come from and how does it interact with :MAP here? | |
end | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment