Real Ruby + Real Sinatra on Cloudflare Workers
This is a real Sinatra application, compiled from Ruby by Opal and served at the edge on Cloudflare Workers. The source code is identical to what you would write against Puma, Unicorn, or any other Rack server.
Rendered through a <%= erb :index %>-style
template, exactly like the Sinatra README recommends.
params exampledb/migrations/0001_create_posts.rb ใฎ Sequel migration ใ
wrangler d1 migrations apply --remote ใงๆฌ็ช้ฉ็จใใๆฐใใผใใซใ
POST /posts ใซ {"title": "...", "body": "..."} ใๆใใใจไฝๆ/kv/:key ใงๆธ่พผ)/r2/:key ใงๆธ่พผ)POST /api/login โ JWT ็บ่ก (HS256) ·
GET /api/me · POST /api/login/refreshNet::HTTP.get_response ใงๅค้จ API ๅฉใCloudflare::HTTP.fetch ็ดๅฉใHOMURABI_ENABLE_CRYPTO_DEMOS=1 ๅฟ
่ฆ)HOMURABI_ENABLE_SCHEDULED_DEMOS=1 ๅฟ
่ฆ)HOMURABI_ENABLE_FOUNDATIONS_DEMOS=1 ๅฟ
่ฆ)HOMURABI_ENABLE_BINDING_DEMOS=1 ๅฟ
่ฆ)There are currently 6 users in the D1 database: