diff options
author | 2016-02-14 10:58:18 +0100 | |
---|---|---|
committer | 2016-02-14 10:58:18 +0100 | |
commit | ccae0382bb750c1deded19e05b34933a8303465e (patch) | |
tree | 1a2f0ae972163e6c1c76611b464d4257947c003e /plugins/boot.lua | |
parent | 2db49088141b6238e92aecc4c073076a02c73065 (diff) |
Added plugins and boot.lua as startup script [Miodrag Milanovic]
Diffstat (limited to 'plugins/boot.lua')
-rw-r--r-- | plugins/boot.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/boot.lua b/plugins/boot.lua new file mode 100644 index 00000000000..e6cdde58004 --- /dev/null +++ b/plugins/boot.lua @@ -0,0 +1,26 @@ +local uv = require('luv') +local cwd = uv.cwd() +package.path = cwd .. "/plugins/?.lua;" .. cwd .. "/plugins/?/init.lua" + +require('weblit/app') + + .bind({ + host = "0.0.0.0", + port = 8080 + }) + + .use(require('weblit/logger')) + .use(require('weblit/auto-headers')) + .use(require('weblit/etag-cache')) + + .route({ + method = "GET", + path = "/", + }, function (req, res, go) + res.code = 200 + res.headers["Content-Type"] = "text/html" + res.body = "<h1>Hello!</h1>\n" + end) + + .start() + |