Skip to content

Instantly share code, notes, and snippets.

@cedricss
Created October 10, 2011 13:07
Show Gist options
  • Select an option

  • Save cedricss/1275272 to your computer and use it in GitHub Desktop.

Select an option

Save cedricss/1275272 to your computer and use it in GitHub Desktop.
Hello world in OPA, with raw text versions.

How to run this example?

hello = <h1>Hello world</h1>>
server = simple_server(parser
| "/rawhtml" -> Resource.raw_text(Xhtml.to_string(hello))
| "/raw" -> Resource.raw_text("Hello world")
| "/" -> Resource.html("Hello world",hello)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment