2014-05-03 03:01:11 +08:00
|
|
|
hapi = require 'hapi'
|
2014-05-02 05:42:15 +08:00
|
|
|
|
2014-05-02 22:44:45 +08:00
|
|
|
log = require './lib/logger'
|
2014-05-03 03:01:11 +08:00
|
|
|
pack = require './package'
|
2014-05-02 22:44:45 +08:00
|
|
|
recWatcher = require './lib/recording-dir-watcher'
|
|
|
|
routes = require './lib/routes'
|
2014-05-02 05:42:15 +08:00
|
|
|
|
2014-05-03 03:01:11 +08:00
|
|
|
server = hapi.createServer("0.0.0.0",
|
2014-05-02 05:42:15 +08:00
|
|
|
parseInt(process.env.PORT, 10) or 4000)
|
2014-05-01 23:30:09 +08:00
|
|
|
|
|
|
|
server.start(() ->
|
2014-05-02 05:42:15 +08:00
|
|
|
log.info(['start'], pack.name + ' - web interface: ' + server.info.uri)
|
2014-05-01 23:30:09 +08:00
|
|
|
)
|
|
|
|
|
2014-05-02 05:42:15 +08:00
|
|
|
server.route(routes.routes)
|
2014-05-03 03:01:11 +08:00
|
|
|
|
|
|
|
recWatcher.watch()
|