diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 14:12:16 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 14:12:16 +0000 |
| commit | 87c165036718abc9b94ca69ea7144c356dd45e3b (patch) | |
| tree | a5c7b7b9519045b007e9758c4facecb343c9b710 /render.moon | |
| parent | small cleaning (diff) | |
| download | mmm-87c165036718abc9b94ca69ea7144c356dd45e3b.tar.gz mmm-87c165036718abc9b94ca69ea7144c356dd45e3b.zip | |
build fixes
Diffstat (limited to 'render.moon')
| -rw-r--r-- | render.moon | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/render.moon b/render.moon index 00f4946..8dca141 100644 --- a/render.moon +++ b/render.moon @@ -1,25 +1,22 @@ package.moonpath = './?.shared.moon;./?.server.moon;' .. package.moonpath import flush from require 'lib.init' -error "please specify the module to build as an argumnet" unless arg[1] +import routes from require 'app' -require "app.#{arg[1]}" - -load_file = (name) -> - file = io.open name - with file\read '*a' - file\close! +route_name = assert arg[1], "please specify the route name to build as an argument" +route = assert routes[route_name], "route not found: '#{route_name}'" +route\render! print "<!DOCTYPE html> <html> <head> <meta charset=\"UTF-8\"> <title>MMM: lunar low-gravity scripting playground</title> - <link rel=\"stylesheet\" type=\"text/css\" href=\"main.css\" /> + <link rel=\"stylesheet\" type=\"text/css\" href=\"/main.css\" /> </head> <body> - <script src=\"fengari-web.js\"></script> - <script type=\"application/lua\" src=\"lib/init.client.moon.lua\"></script> + <script src=\"/fengari-web.js\"></script> + <script type=\"application/lua\" src=\"/lib/init.client.moon.lua\"></script> #{flush!} </body> </html>" |
