aboutsummaryrefslogtreecommitdiffstats
path: root/server.moon
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2018-09-05 00:36:00 +0000
committers-ol <s-ol@users.noreply.github.com>2018-09-05 00:36:00 +0000
commitece199a92220deaa3212fad30f6026693ae86c63 (patch)
treef576a8c160c8827050ef34f474961d89bdff1ac4 /server.moon
parentsome fixes (diff)
downloadmmm-ece199a92220deaa3212fad30f6026693ae86c63.tar.gz
mmm-ece199a92220deaa3212fad30f6026693ae86c63.zip
polymorphic!
Diffstat (limited to 'server.moon')
-rw-r--r--server.moon29
1 files changed, 29 insertions, 0 deletions
diff --git a/server.moon b/server.moon
new file mode 100644
index 0000000..5a79039
--- /dev/null
+++ b/server.moon
@@ -0,0 +1,29 @@
+package.moonpath = './?.server.moon;' .. package.moonpath
+
+export MODE, warn, append
+MODE = 'SERVER'
+warn = (...) ->
+ io.stderr\write table.concat { ... }, '\t'
+ io.stderr\write '\n'
+
+-- shorthand to append elements to body
+buffer = ''
+append = (val) ->
+ buffer ..= val
+flush = ->
+ with x = buffer
+ buffer = ''
+
+error "please specify the module to build as an argumnet" unless arg[1]
+
+require "app.#{arg[1]}"
+
+print "<!DOCTYPE html>
+<html>
+ <head>
+ <title>MMM: lunar low-gravity scripting playground</title>
+ </head>
+ <body>
+ #{flush!}
+ </body>
+</html>"