Skip to content

Commit

Permalink
use paths.thisfile instead of sys.fpath
Browse files Browse the repository at this point in the history
  • Loading branch information
soumith committed Mar 5, 2016
1 parent d054497 commit c5ebae4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

local async = require('async')
local paths = require('paths')
local sys = require('sys')

local function getMime(ext)
if ext == '.css' then
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit c5ebae4

Please sign in to comment.