
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
webservice
Advanced tools
webservice gem - yet another HTTP JSON API (web service) builder
Dynamic Example • Classic Example • Rackup Example
You can load services at-runtime from files using Webservice.load_file.
Example:
# service.rb
get '/' do
'Hello, world!'
end
and
# server.rb
require 'webservice'
App = Webservice.load_file( './service.rb' )
App.run!
and to run type
$ ruby ./server.rb
# server.rb
require 'webservice'
class App < Webservice::Base
get '/' do
'Hello, world!'
end
end
App.run!
and to run type
$ ruby ./server.rb
Use config.ru and rackup. Example:
# config.ru
require `webservice`
class App < Webservice::Base
get '/' do
'Hello, world!'
end
end
run App
and to run type
$ rackup # will (auto-)load config.ru
Note: config.ru is a shortcut (inline)
version of Rack::Builder.new do ... end:
# server.rb
require 'webservice'
class App < Webservice::Base
get '/' do
'Hello, world!'
end
end
builder = Rack::Builder.new do
run App
end
Rack::Server.start builder.to_app
and to run type
$ ruby ./server.rb
See
beerkit / beer.db.service -
beer.db HTTP JSON API (web service) scripts e.g.
get '/beer/(r|rnd|rand|random)' do # special keys for random beer
Beer.rnd
end
get '/beer/:key'
Beer.find_by! key: params['key']
end
get '/brewery/(r|rnd|rand|random)' do # special keys for random brewery
Brewery.rnd
end
get '/brewery/:key'
Brewery.find_by! key: params['key']
end
...
worlddb / world.db.service -
world.db HTTP JSON API (web service) scripts
get '/countries(.:format)?' do
Country.by_key.all # sort/order by key
end
get '/cities(.:format)?' do
City.by_key.all # sort/order by key
end
get '/tag/:slug(.:format)?' do # e.g. /tag/north_america.csv
Tag.find_by!( slug: params['slug'] ).countries
end
...
sportdb / sport.db.service -
sport.db (football.db) HTTP JSON API (web service) scripts
The webservice scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
FAQs
Unknown package
We found that webservice demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.