tumble/bin/devserver

17 lines
611 B
Plaintext
Raw Permalink Normal View History

2016-06-29 14:34:18 +00:00
#!/usr/bin/env coffee
staticserver = require('node-static')
files = new(staticserver.Server)('./dist')
require('http').createServer((request, response) ->
request.addListener 'end', ->
files.serve request, response, (err, res) ->
if (err)
console.error("> Error serving " + request.url + " - " + err.message)
response.writeHead(err.status, err.headers)
response.end()
else
console.log("> " + request.url + " - " + res.message)
).listen(8081)
console.log("> node-static is listening on http://127.0.0.1:8081")