[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Simple ruby web server

Filipe

10/5/2007 1:46:00 AM

Hi all,

I'm looking for a simple webserver that could handle basic requests
(mostly from a localhost) outputing html files. It should also be able
to get the input from forms. Rails seems too powerful to perform such
a simple class.

Sorry if this sounds confusing. I'm a newcomer to the ruby language.

6 Answers

Konrad Meyer

10/5/2007 2:10:00 AM

0

Quoth Filipe:
> Hi all,
>
> I'm looking for a simple webserver that could handle basic requests
> (mostly from a localhost) outputing html files. It should also be able
> to get the input from forms. Rails seems too powerful to perform such
> a simple class.
>
> Sorry if this sounds confusing. I'm a newcomer to the ruby language.

Look into WEBrick / GServer.

--
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertil...

dusty

10/5/2007 4:02:00 AM

0

On Oct 4, 10:09 pm, Konrad Meyer <kon...@tylerc.org> wrote:
> Quoth Filipe:
>
> > Hi all,
>
> > I'm looking for a simple webserver that could handle basic requests
> > (mostly from a localhost) outputing html files. It should also be able
> > to get the input from forms. Rails seems too powerful to perform such
> > a simple class.
>
> > Sorry if this sounds confusing. I'm a newcomer to the ruby language.
>
> Look into WEBrick / GServer.
>
> --
> Konrad Meyer <kon...@tylerc.org>http://konrad.sobertil...
>
> signature.asc
> 1KDownload

#!/bin/env ruby
require 'webrick'
include WEBrick

s = HTTPServer.new(
:Port => 2000,
:DocumentRoot => Dir::pwd
)

trap("INT"){ s.shutdown }
s.start

Run that in a directory with html files. That will serve them up for
ya, then go from there.

If you want a small mvc pattern, then check out camping. A little
more in-depth but smaller than rails is merb. I prefer merb myself.




John Joyce

10/5/2007 4:24:00 AM

0


On Oct 4, 2007, at 8:50 PM, Filipe wrote:

> Hi all,
>
> I'm looking for a simple webserver that could handle basic requests
> (mostly from a localhost) outputing html files. It should also be able
> to get the input from forms. Rails seems too powerful to perform such
> a simple class.
>
> Sorry if this sounds confusing. I'm a newcomer to the ruby language.
>
>
Rails isn't a web server.
Apache is a web server.
Rails is (like any web framework) a glorified CGI program.
There is Merb, and Camping, and Ruby does have a CGI class...

James Britt

10/5/2007 5:15:00 AM

0

dusty wrote:
>
> If you want a small mvc pattern, then check out camping. A little
> more in-depth but smaller than rails is merb. I prefer merb myself.


Also look at Nitro and Ramaze, both of which make it quite simple to
develop Web sites using a range of techniques, from all-in-one-file to
full-blown MVC, with or without a database.




--
James Britt

"Every object obscures another object."
- Luis Bunuel

Filipe

10/6/2007 1:31:00 AM

0

On Oct 5, 2:15 am, James Britt <james.br...@gmail.com> wrote:
> dusty wrote:
>
> > If you want a small mvc pattern, then check out camping. A little
> > more in-depth but smaller than rails is merb. I prefer merb myself.
>
> Also look at Nitro and Ramaze, both of which make it quite simple to
> develop Web sites using a range of techniques, from all-in-one-file to
> full-blown MVC, with or without a database.
>
> --
> James Britt
>
> "Every object obscures another object."
> - Luis Bunuel

Webrick seems to be what I'm looking for. However I couldn't find any
tutorial/sample or documentation for it. Is there any sample avaliable
on the web?

James Britt

10/6/2007 2:45:00 AM

0

Filipe wrote:
>
> Webrick seems to be what I'm looking for. However I couldn't find any
> tutorial/sample or documentation for it. Is there any sample avaliable
> on the web?

http://segment7.net/projects/rub...


--
James Britt

"Those who would give up Essential Liberty to purchase a little
Temporary Safety, deserve neither Liberty nor Safety."
- Benjamin Franklin, when asked about static typing
(and a tip of the hat to raganwald)