Skip to content

Commit f3461e1

Browse files
committed
Merge pull request #21 from soumith/fixpaths
use paths.thisfile instead of sys.fpath
2 parents d054497 + c5ebae4 commit f3461e1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
local async = require('async')
88
local paths = require('paths')
9-
local sys = require('sys')
109

1110
local function getMime(ext)
1211
if ext == '.css' then
@@ -58,7 +57,7 @@ local function handler(req, res, client)
5857
local ext = string.match(path, "%.%l%l%l?")
5958
local mime = getMime(ext)
6059

61-
local file = io.open(paths.dirname(sys.fpath()) .. '/static' .. path, 'r')
60+
local file = io.open(paths.dirname(paths.thisfile()) .. '/static' .. path, 'r')
6261
if file ~= nil then
6362
local content = file:read("*all")
6463
file:close()

0 commit comments

Comments
 (0)