[Nitro] Suggestions

dirk dirk.barnikel at gmx.de
Tue Sep 20 03:56:18 EDT 2005


in my application I need to do a couple of things after webricks listening 
port is set up and before the server is started:

* Changing the processes uid (Unix)
* Mount other webrick-servlets

To do this I added to Webrick#start:

	@webrick = WEBrick::HTTPServer.new(webrick_options)	
	self.hook(@webrick)	if self.respond_to?('hook')               <----- added
	trap('INT') { @webrick.shutdown }      
	@webrick.mount('/', WebrickAdapter, server)

The hook-method is defined in an application specific part of the sourcecode.

I also had do change the first lines of Webrick#start, because the
condition 'if RUBY_PLATFORM ...' causes nitro always to log into
/dev/null on unix.

Many thanks to the developers for giving us nitro :-))

Regards, Dirk

More information about the Nitro-general mailing list