add ca service

This commit is contained in:
Artur Gurgul 2025-08-13 07:06:53 +02:00
parent ca5d4c4b72
commit 8bbf7d31a5
10 changed files with 87 additions and 3 deletions

6
bin/services/ca/Gemfile Normal file
View file

@ -0,0 +1,6 @@
source "https://rubygems.org"
ruby ">= 3.0"
gem "roda"
gem "puma"
gem "rackup"

View file

@ -0,0 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
nio4r (2.7.4)
puma (6.6.1)
nio4r (~> 2.0)
rack (3.2.0)
rackup (2.2.1)
rack (>= 3)
roda (3.95.0)
rack
PLATFORMS
arm64-darwin-24
ruby
DEPENDENCIES
puma
rackup
roda
RUBY VERSION
ruby 3.4.5p51
BUNDLED WITH
2.6.9

12
bin/services/ca/app.rb Normal file
View file

@ -0,0 +1,12 @@
require "roda"
class App < Roda
# automatically sets application/json and encodes Ruby objects
plugin :json
route do |r|
r.get "hello" do
{ message: "world" }
end
end
end

View file

@ -0,0 +1,2 @@
require_relative "app"
run App.freeze.app

0
bin/services/ca/make Executable file
View file

View file

@ -0,0 +1,9 @@
bundle exec rackup -p 9292 -o 0.0.0.0
RACK_ENV=production bundle exec rackup -p 8080 -o 0.0.0.0
curl http://0.0.0.0:9292/hello --verbose