Skip to content

Commit

Permalink
Merge pull request #182 from marmelab/fix-data-path-resolution
Browse files Browse the repository at this point in the history
Fix data path resolution to allow absolute paths
  • Loading branch information
djhi authored Aug 9, 2024
2 parents f5f31d1 + dc3e2b2 commit 23600d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/json-graphql-server.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var express = require('express');
var cors = require('cors');
var JsonGraphqlServer = require('../dist/json-graphql-server-node.cjs').default;
var dataFilePath = process.argv.length > 2 ? process.argv[2] : './data.json';
var data = require(path.join(process.cwd(), dataFilePath));
var data = require(path.resolve(process.cwd(), dataFilePath));
var PORT = process.env.NODE_PORT || 3000;
var HOST = process.env.NODE_HOST || 'localhost';
var app = express();
Expand Down

0 comments on commit 23600d5

Please sign in to comment.