diff options
| -rw-r--r-- | app/init.moon | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/init.moon b/app/init.moon index e1f7a75..7d810cb 100644 --- a/app/init.moon +++ b/app/init.moon @@ -15,7 +15,7 @@ client_goto = -> { :location } = window if module = location.search\match 'client=([%w_]+)' document.body.innerHTML = '' - require 'app.' .. module + require "app.#{module}" experiments = { { @@ -49,6 +49,7 @@ experiments = { { name: 'mmmfs' desc: 'an operating, file- and living system' + render: 'client' }, } @@ -93,9 +94,14 @@ table.insert routes, { on_client client_goto } +load = (module) -> require "app.#{module}" + destify = (route) -> with route .route or= .name .dest or= "#{.route}/index.html" + + if .render == 'client' + .render = -> on_client load, .name .render or= -> require '.' .. .name routes = [ destify route for route in *routes ] |
