aboutsummaryrefslogtreecommitdiff
path: root/examples/http-server/sample-site
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-01 21:15:17 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-01 21:15:17 -0400
commit428f035d9ea21d3e23dc9b96e72d3c7cd6a8c493 (patch)
treed5c141d52e60d8d7d88056ab1c98a27df13f23b5 /examples/http-server/sample-site
parentf32d2a25c10977f52c83ddef77008afd22e7f0ce (diff)
Add http-server example
Diffstat (limited to 'examples/http-server/sample-site')
-rw-r--r--examples/http-server/sample-site/foo.html6
-rw-r--r--examples/http-server/sample-site/hello.txt1
-rw-r--r--examples/http-server/sample-site/index.html16
-rwxr-xr-xexamples/http-server/sample-site/random.tm5
-rw-r--r--examples/http-server/sample-site/styles.css11
5 files changed, 39 insertions, 0 deletions
diff --git a/examples/http-server/sample-site/foo.html b/examples/http-server/sample-site/foo.html
new file mode 100644
index 00000000..162a7146
--- /dev/null
+++ b/examples/http-server/sample-site/foo.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+ <body>
+ This is the <b>foo</b> page.
+ </body>
+</html>
diff --git a/examples/http-server/sample-site/hello.txt b/examples/http-server/sample-site/hello.txt
new file mode 100644
index 00000000..e965047a
--- /dev/null
+++ b/examples/http-server/sample-site/hello.txt
@@ -0,0 +1 @@
+Hello
diff --git a/examples/http-server/sample-site/index.html b/examples/http-server/sample-site/index.html
new file mode 100644
index 00000000..8e1573bb
--- /dev/null
+++ b/examples/http-server/sample-site/index.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>HTTP Example</title>
+ <link rel="stylesheet" href="styles.css">
+ </head>
+ <body>
+ <p>
+ Hello <b>world!</b>
+ </p>
+
+ <p>
+ Try going to <a href="/random">/random</a> or <a href="/foo">/foo</a> or <a href="/hello.txt">/hello.txt</a>
+ </p>
+ </body>
+</html>
diff --git a/examples/http-server/sample-site/random.tm b/examples/http-server/sample-site/random.tm
new file mode 100755
index 00000000..7d183ee9
--- /dev/null
+++ b/examples/http-server/sample-site/random.tm
@@ -0,0 +1,5 @@
+#!/bin/env tomo
+use random
+
+func main():
+ say("Random: $(random:int(1,100))")
diff --git a/examples/http-server/sample-site/styles.css b/examples/http-server/sample-site/styles.css
new file mode 100644
index 00000000..f15d25de
--- /dev/null
+++ b/examples/http-server/sample-site/styles.css
@@ -0,0 +1,11 @@
+body{
+ margin:40px auto;
+ max-width:650px;
+ line-height:1.6;
+ font-size:18px;
+ color:#444;
+ padding:0 10px;
+}
+h1,h2,h3{
+ line-height:1.2
+}