Created
February 25, 2021 08:21
-
-
Save kinnalru/7fd5ba10e81ec109de3dfe29a1e4a78d to your computer and use it in GitHub Desktop.
StartWebrick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class StartWebrick < Base | |
def start | |
server = WEBrick::HTTPServer.new Host: '0.0.0.0', Port: @port, MaxClients: 3000, ShutdownSocketWithoutClose: true, Logger: Logger.new(IO::NULL), AccessLog: [] | |
server.mount_proc('/') { |req, res| res.body = 'hello' } | |
server.start | |
end | |
def stop(pid) | |
Process.kill("KILL", pid) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment