[erlang-questions] [Erlyaws-list] sgte - erlang template engine

Bob Ippolito bob@REDACTED
Mon Mar 12 10:32:51 CET 2007


On 3/12/07, Claes Wikström <klacke@REDACTED> wrote:
> Filippo Pacini wrote:
> > Hi all,
> > I'm working on an Erlang template language based on String Template
> > www.stringtemplate.org
> >
>
> What would be the best way to let yaws handle .eg .st files
> Should I allow for external renderers to register their
> file suffixes and associate those to a render module.
>
> Maybe a good idea would be to rip the .yaws support
> out from yaws_server.erl, put it in an external module
> and then register that external module as the handler for
> pages with .yaws suffix ?? and then the same thing for cgi etc ...
>
> That way it will be easy to plug in any external rendering
> engine, for example a string template implementattion

It would be great if yaws was split into more components like that. We
only use it because it's a working HTTP server protocol
implementation. We're serving appmods from it, and nothing else (not
even static files). We've also got all of the logging shut off because
we have application-specific logs. I would prefer a lighter and easier
to understand solution than Yaws, but I couldn't find an alternative
HTTP implementation that was half-decent and didn't suffer from the
same kind of monolithic bloat that yaws and httpd do.

On another note, when I was prototyping something w/ Yaws yesterday I
thought it would be nice if there was a return value that could be
used to serve a file from disk from an appmod. Right now I just read
the whole thing as a binary and return that, but it would be
preferable if I could just give the path to yaws and let it serve the
file... e.g. {file, ContentType, Path}. Maybe even allow IoDevice in
addition to paths to support already open files?

-bob




More information about the erlang-questions mailing list