diff --git a/server.lua b/server.lua index b6f92dd..395b59b 100644 --- a/server.lua +++ b/server.lua @@ -6,7 +6,6 @@ local async = require('async') local paths = require('paths') -local sys = require('sys') local function getMime(ext) if ext == '.css' then @@ -58,7 +57,7 @@ local function handler(req, res, client) local ext = string.match(path, "%.%l%l%l?") local mime = getMime(ext) - local file = io.open(paths.dirname(sys.fpath()) .. '/static' .. path, 'r') + local file = io.open(paths.dirname(paths.thisfile()) .. '/static' .. path, 'r') if file ~= nil then local content = file:read("*all") file:close()