mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Add a more involved REST example
A pastebin type application that can optionally highlight the output as both text and HTML.
This commit is contained in:
parent
ae401f7460
commit
d7b83db92e
11 changed files with 303 additions and 0 deletions
22
examples/rest_pastebin/priv/index.html
Normal file
22
examples/rest_pastebin/priv/index.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Simple Pastebin</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Simple Pastebin</h1>
|
||||
<p>
|
||||
You can paste your text into the text field to submit, or you can
|
||||
capture the output of a command with:
|
||||
</p>
|
||||
<code>
|
||||
<i>command</i> | curl -i --data-urlencode paste@- localhost:8080
|
||||
</code>
|
||||
<form action="/" method="post">
|
||||
<textarea cols="80" rows="15" name="paste"></textarea>
|
||||
<div>
|
||||
<button type="submit">Upload your code</button>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
7
examples/rest_pastebin/priv/index.txt
Normal file
7
examples/rest_pastebin/priv/index.txt
Normal file
|
@ -0,0 +1,7 @@
|
|||
Simple Pastebin
|
||||
---------------
|
||||
|
||||
You can paste your text into the text field to submit, or you can capture the
|
||||
output of a command with:
|
||||
|
||||
<command> | curl -i --data-urlencode paste@- localhost:8080
|
Loading…
Add table
Add a link
Reference in a new issue