22 lines
423 B
Ruby
Executable File
22 lines
423 B
Ruby
Executable File
#!/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
|