Skip to content

Commit

Permalink
Merge pull request #3 from jmargail/main
Browse files Browse the repository at this point in the history
Directus URL initialization with base path
  • Loading branch information
rijkvanzanten authored Nov 3, 2022
2 parents 88be8b6 + 0118b8b commit eb16c7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,15 @@ class Plugin {

try {
const baseUrl = new URL(url);

baseUrl.pathname = '/';
const basePath = baseUrl.pathname;

baseUrl.pathname = basePath;
this.url = baseUrl.toString();

baseUrl.pathname = '/graphql';
baseUrl.pathname = basePath + '/graphql';
this.urlGraphql = baseUrl.toString();

baseUrl.pathname = '/graphql/system';
baseUrl.pathname = basePath + '/graphql/system';
this.urlGraphqlSystem = baseUrl.toString();
} catch (err) {
error('"url" should be a valid URL');
Expand Down

0 comments on commit eb16c7c

Please sign in to comment.