MochiWeb + Web

9 views
Skip to first unread message

Dmitrii 'Mamut' Dimandt

unread,
Dec 12, 2007, 7:31:13 AM12/12/07
to moch...@googlegroups.com
How would you approach building a website using mochiweb?

Are there any ideas how an (M)VC framework could be constructed (VC
being more important than M)?

Roberto Saccon

unread,
Dec 12, 2007, 10:57:16 AM12/12/07
to MochiWeb
Ideas are cheap (implementing them is expensive), so here is one:

take Filippos http://code.google.com/p/ewgi/, slightly adapt erlyweb
any you have a MVC on Mochiweb (and use a CDN or nginx for the static
stuff)

I am actually putting together something like a (M)VC built on top of
MochiWeb, it is just not ready yet ...

regards
Roberto

On Dec 12, 10:31 am, "Dmitrii 'Mamut' Dimandt" <dmitr...@gmail.com>
wrote:

Filippo Pacini

unread,
Dec 12, 2007, 6:08:58 PM12/12/07
to moch...@googlegroups.com
Since Roberto mentioned ewgi...
what I'd like to do with ewgi is this:
- a server module that talks to the web server

- a restful dispatcher to handle requests:
the dispatcher should get a specification list like
[{'GET', "/an_url", Handler},
{'POST', "/another_url", Handler2}, ...]

Handlers could be either {Module, Fun} or {Node, module, Fun} if the
handler should be called on a remote node. Or a list of Handlers to be
called in sequence.

- A template language for the view part.
I use sgte http://code.google.com/p/sgte/ , but I'm a little biased
since I'm the author :-)

ewgi should allow easy composition of the various parts. At least when
it will be more defined :-). At the moment I'm experimenting with the
interface I've defined to see if it works.

cheers,
filippo

Dmitrii 'Mamut' Dimandt

unread,
Dec 13, 2007, 2:42:58 AM12/13/07
to moch...@googlegroups.com
Roberto Saccon wrote:
> Ideas are cheap (implementing them is expensive), so here is one:
>
>
Oh, shoot :) I hoped someone would just appear and say: "Hey, I got what
you need right here" :))))

> take Filippos http://code.google.com/p/ewgi/, slightly adapt erlyweb
> any you have a MVC on Mochiweb (and use a CDN or nginx for the static
> stuff)
>
>
Thank you! I'll take a look at that!

Dmitrii 'Mamut' Dimandt

unread,
Dec 13, 2007, 2:45:04 AM12/13/07
to moch...@googlegroups.com
Filippo Pacini wrote:
> Since Roberto mentioned ewgi...
> what I'd like to do with ewgi is this:
> - a server module that talks to the web server
>
> - a restful dispatcher to handle requests:
> the dispatcher should get a specification list like
> [{'GET', "/an_url", Handler},
> {'POST', "/another_url", Handler2}, ...]
>
> Handlers could be either {Module, Fun} or {Node, module, Fun} if the
> handler should be called on a remote node. Or a list of Handlers to be
> called in sequence.
>
> - A template language for the view part.
> I use sgte http://code.google.com/p/sgte/ , but I'm a little biased
> since I'm the author :-)
>
> ewgi should allow easy composition of the various parts. At least when
> it will be more defined :-). At the moment I'm experimenting with the
> interface I've defined to see if it works.
>
Interesting! I'll take a look :)

Matthew Dempsky

unread,
Dec 13, 2007, 5:29:29 AM12/13/07
to moch...@googlegroups.com
On Dec 12, 2007 3:08 PM, Filippo Pacini <filippo...@gmail.com> wrote:
> - a restful dispatcher to handle requests:
> the dispatcher should get a specification list like
> [{'GET', "/an_url", Handler},
> {'POST', "/another_url", Handler2}, ...]

Whatever dispatch system you finalize on, I suggest that you first
lookup by URL path, then lookup by HTTP method. If the first lookup
fails, return a 404 error; if the second lookup fails, return a 405
error and set the Allowed field in the response header.

Filippo Pacini

unread,
Dec 13, 2007, 6:28:19 AM12/13/07
to moch...@googlegroups.com
Thanks Matthew,
you are right.

In the past in python I had used 501 (Method Not Implemened) has a
status code when the method did not match, but rereading the rfc 405 is
the right response.

thanks,
filippo

Yariv Sadan

unread,
Dec 14, 2007, 10:25:22 PM12/14/07
to moch...@googlegroups.com
>
> I am actually putting together something like a (M)VC built on top of
> MochiWeb, it is just not ready yet ...
>


I think you'll get more bang for your buck by porting ErlyWeb to
MochiWeb. Why duplicate all the work that went into ErlyWeb just to
support another web server?

Yariv

Roberto Saccon

unread,
Dec 14, 2007, 11:58:45 PM12/14/07
to MochiWeb
Haven't I just convinced Dmitrii to port ErlyWeb to MochiWeb ? That's
the most bang for my buck :)))

Roberto

On Dec 15, 1:25 am, "Yariv Sadan" <yari...@gmail.com> wrote:
> > I am actually putting together something like a (M)VC built on top of
> > MochiWeb, it is just not ready yet ...
>
> I think you'll get more bang for your buck by porting ErlyWeb to
> MochiWeb. Why duplicate all the work that went into ErlyWeb just to
> support another web server?
>
> Yariv
>
> On Dec 12, 2007 7:57 AM, Roberto Saccon <rsac...@gmail.com> wrote:
>
>
>
> > Ideas are cheap (implementing them is expensive), so here is one:
>
> > take Filipposhttp://code.google.com/p/ewgi/, slightly adapt erlyweb

Yariv Sadan

unread,
Dec 15, 2007, 12:25:49 AM12/15/07
to moch...@googlegroups.com
I was responding to the (M)VC thingy you said you were building. Are you?

Dmitrii 'Mamut' Dimandt

unread,
Dec 15, 2007, 4:21:24 AM12/15/07
to moch...@googlegroups.com

> Haven't I just convinced Dmitrii to port ErlyWeb to MochiWeb ? That's
> the most bang for my buck :)))
>
Hey, I didn't say I was going to do it :))))))))
Though that would be an interesting project to bang my head on
Reply all
Reply to author
Forward
0 new messages