Simple ruby web server

F

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.
 
K

Konrad Meyer

--nextPart297894581.WoHUOW7hSk
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Quoth Filipe:
Hi all,
=20
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.
=20
Sorry if this sounds confusing. I'm a newcomer to the ruby language.

Look into WEBrick / GServer.

=2D-=20
Konrad Meyer <[email protected]> http://konrad.sobertillnoon.com/

--nextPart297894581.WoHUOW7hSk
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBHBZzoCHB0oCiR2cwRAnIVAJ9TzwSRBrMNPA3uMWOsCdy/4hSD3gCfXjjf
PT+n/CPHGYGXZ78M1HAD59Y=
=+wxK
-----END PGP SIGNATURE-----

--nextPart297894581.WoHUOW7hSk--
 
D

dusty

Quoth Filipe:




Look into WEBrick / GServer.

--
Konrad Meyer <[email protected]>http://konrad.sobertillnoon.com/

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.
 
J

John Joyce

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...
 
J

James Britt

dusty said:
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.
 
F

Filipe

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?
 
J

James Britt

Filipe said:
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/ruby/WEBrick/


--
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,268
Messages
2,571,344
Members
48,019
Latest member
Migration_Expert

Latest Threads

Top