summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/boot.lua
blob: e6cdde58004aaa388423cabf7c1c4d1798dd3938 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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()