Skip to content

Commit

Permalink
Merge pull request #5 from stevent-team/fix/path-resolution
Browse files Browse the repository at this point in the history
Fix Path Resolution
  • Loading branch information
giraugh authored May 17, 2022
2 parents f018f94 + 2b06632 commit 8cd3f1e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const serve = async ({ target, routeFile, host, port, index }) => {
// Load routes
let routes: Routes = {}
if (routeFile) {
const resolvedRoutes = path.resolve(__dirname, routeFile)
const resolvedRoutes = path.resolve(routeFile)
routes = await loadRoutes(resolvedRoutes).catch(() => {
throw new Error(`Failed to load routes file: ${resolvedRoutes}`)
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stevent-team/epoxy",
"version": "1.0.0",
"version": "1.0.1",
"description": "Lightweight server-side per-route html injection",
"keywords": [
"epoxy",
Expand Down
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const startServer = async ({
routes,
}) => {
// Resolve paths
const resolvedTarget = path.resolve(__dirname, target)
const resolvedIndex = path.resolve(__dirname, index)
const resolvedTarget = path.resolve(target)
const resolvedIndex = path.resolve(index)

// Read index
const indexText = await fs.readFile(resolvedIndex, 'utf-8').catch((e) => {
Expand Down

0 comments on commit 8cd3f1e

Please sign in to comment.