1
0
Fork 0
backend/main.rb

22 lines
423 B
Ruby
Raw Normal View History

2023-02-04 23:43:57 +00:00
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'connection_pool'
require 'pg'
require 'sinatra'
$DB_POOL = ConnectionPool.new size: 5, timeout: 5 do
PG.connect(
host: 'pg.causa-arcana.com',
dbname: 'leqsikoni',
user: 'leqsikoni',
password: 'ggeucene3ou7mqh2upehhm52tfp5bkcj',
)
end
get '/' do
$DB_POOL.with do |db_conn|
db_conn.exec('SELECT * FROM languages').to_a.inspect
end
end