bf1558eeb0
### Summary The `server` package implements a static file web server intended to be used during development. The goal is to have it as close to a production environment as possible. Not there yet. This is the first step.
890 B
890 B
About
server.rb implements a static file web server by using the fast performing Ruby web server Puma and a small Rack application.
Examples
Server.for_dir
The Server.for_dir
method returns a Server instance
that serves the contents of a directory. Server#start
spawns
a new thread to listen for requests, and afterwards returns
the thread. Thread#join
can block execution at that point,
or execution can continue as normal by not calling Thread#join
:
require "server"
##
# Create a Server instance for the contents of a directory
server = Server.for_dir("./build/website/")
##
# Start listening for connections
thr = server.start
##
# Prevent the main thread from exiting
thr.join
License
BSD Zero Clause.
See LICENSE.