From 428f035d9ea21d3e23dc9b96e72d3c7cd6a8c493 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Apr 2025 21:15:17 -0400 Subject: Add http-server example --- examples/http-server/sample-site/foo.html | 6 ++++++ examples/http-server/sample-site/hello.txt | 1 + examples/http-server/sample-site/index.html | 16 ++++++++++++++++ examples/http-server/sample-site/random.tm | 5 +++++ examples/http-server/sample-site/styles.css | 11 +++++++++++ 5 files changed, 39 insertions(+) create mode 100644 examples/http-server/sample-site/foo.html create mode 100644 examples/http-server/sample-site/hello.txt create mode 100644 examples/http-server/sample-site/index.html create mode 100755 examples/http-server/sample-site/random.tm create mode 100644 examples/http-server/sample-site/styles.css (limited to 'examples/http-server/sample-site') 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 @@ + + + + This is the foo page. + + 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 @@ + + + + HTTP Example + + + +

+ Hello world! +

+ +

+ Try going to /random or /foo or /hello.txt +

+ + 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 +} -- cgit v1.2.3