Project

adelnor

0.01
The project is in a healthy, maintained state
A dead simple, yet Rack-compatible, HTTP server written in Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.2
~> 2.6
 Project Readme

adelnor

rubygems rubygems rubygems

Build Ruby Style Guide Ruby Style Guide

     ___       _______   _______  __      .__   __.   ______   .______      
    /   \     |       \ |   ____||  |     |  \ |  |  /  __  \  |   _  \     
   /  ^  \    |  .--.  ||  |__   |  |     |   \|  | |  |  |  | |  |_)  |    
  /  /_\  \   |  |  |  ||   __|  |  |     |  . `  | |  |  |  | |      /     
 /  _____  \  |  '--'  ||  |____ |  `----.|  |\   | |  `--'  | |  |\  \----.
/__/     \__\ |_______/ |_______||_______||__| \__|  \______/  | _| `._____|

adelnor is a dead simple, yet Rack-compatible, HTTP server written in Ruby.

Requirements

Ruby

Installation

$ gem install adelnor

Development tooling

Make and Docker

Using make

$ make help

Output:

Usage: make <target>
  help                       Prints available commands
  sample.server              Runs a sample server in the port 3000
  bundle.install             Installs the Ruby gems
  bash                       Creates a container Bash
  run.tests                  Runs Unit tests
  rubocop                    Runs code linter
  ci                         Runs Unit tests in CI
  gem.publish                Publishes the gem to https://rubygems.org (auth required)
  gem.yank                   Removes a specific version from the Rubygems

Running a sample server in development

$ make bundle.install
$ make sample.server

Handling concurrency

Currently Adelnor allows to run the server using different concurrency strategies, one at a time.

require './lib/adelnor/server'

app = -> (env) do
  [200, { 'Content-Type' => 'text/html' }, 'Hello world!']
end

# Threaded mode
Adelnor::Server.run app, 3000, thread_pool: 5

# Clusterd mode (forking)
Adelnor::Server.run app, 3000, workers: 2

# Async mode
Adelnor::Server.run app, 3000, async: true

Open http://localhost:3000