0

I downloaded Yaws on Ubuntu 19.04, cloned klacke's project, and configured my /etc/yaws/yaws.config to point to that project.

When I create a new .yaws file and access localhost:port/page_name.yaws, it returns the raw code like:

method(Arg) -> Rec = Arg#arg.req, Rec#http_request.method.
out(Arg) -> {ehtml, f("Method: ~s" , [method(Arg)])}.

on my browser. I have even tried to wrap everything within "html" tags, but it still fails to render properly.

Is there anything I am missing?

Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46

1 Answers1

1

You're missing the <erl> and </erl> tags around your code. Try this instead:

<erl>
method(Arg) ->
    Rec = Arg#arg.req, Rec#http_request.method.
out(Arg) ->
    {ehtml, f("Method: ~s" , [method(Arg)])}.
</erl>

Fetching the page with the tags properly in place produces this result:

Method: GET
Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46