@graphql-mesh/http 0.1.27 → 0.1.28-alpha-20221007102823-ef81a4541
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -3
- package/index.mjs +3 -3
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -53,7 +53,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
53
53
|
} = rawServeConfig;
|
|
54
54
|
const serverAdapter = server.createServerAdapter(ittyRouter.Router());
|
|
55
55
|
serverAdapter.all('/healthcheck', () => new fetch.Response(null, {
|
|
56
|
-
status:
|
|
56
|
+
status: 200,
|
|
57
57
|
}));
|
|
58
58
|
serverAdapter.all('/readiness', () => new fetch.Response(null, {
|
|
59
59
|
status: readyFlag ? 204 : 503,
|
|
@@ -80,7 +80,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
80
80
|
const indexPath = crossHelpers.path.join(baseDir, staticFiles, 'index.html');
|
|
81
81
|
serverAdapter.get('*', async (request) => {
|
|
82
82
|
const url = new URL(request.url);
|
|
83
|
-
if (url.pathname === '/' && (await utils.pathExists(indexPath))) {
|
|
83
|
+
if (graphqlPath !== '/' && url.pathname === '/' && (await utils.pathExists(indexPath))) {
|
|
84
84
|
const indexFile = await crossHelpers.fs.promises.readFile(indexPath);
|
|
85
85
|
return new fetch.Response(indexFile, {
|
|
86
86
|
status: 200,
|
|
@@ -99,7 +99,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
99
99
|
return undefined;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
else {
|
|
102
|
+
else if (graphqlPath !== '/') {
|
|
103
103
|
serverAdapter.get('/', () => new fetch.Response(null, {
|
|
104
104
|
status: 302,
|
|
105
105
|
headers: {
|
package/index.mjs
CHANGED
|
@@ -49,7 +49,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
49
49
|
} = rawServeConfig;
|
|
50
50
|
const serverAdapter = createServerAdapter(Router());
|
|
51
51
|
serverAdapter.all('/healthcheck', () => new Response(null, {
|
|
52
|
-
status:
|
|
52
|
+
status: 200,
|
|
53
53
|
}));
|
|
54
54
|
serverAdapter.all('/readiness', () => new Response(null, {
|
|
55
55
|
status: readyFlag ? 204 : 503,
|
|
@@ -76,7 +76,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
76
76
|
const indexPath = path.join(baseDir, staticFiles, 'index.html');
|
|
77
77
|
serverAdapter.get('*', async (request) => {
|
|
78
78
|
const url = new URL(request.url);
|
|
79
|
-
if (url.pathname === '/' && (await pathExists(indexPath))) {
|
|
79
|
+
if (graphqlPath !== '/' && url.pathname === '/' && (await pathExists(indexPath))) {
|
|
80
80
|
const indexFile = await fs.promises.readFile(indexPath);
|
|
81
81
|
return new Response(indexFile, {
|
|
82
82
|
status: 200,
|
|
@@ -95,7 +95,7 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, rawServeConfig = {}, pla
|
|
|
95
95
|
return undefined;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
|
-
else {
|
|
98
|
+
else if (graphqlPath !== '/') {
|
|
99
99
|
serverAdapter.get('/', () => new Response(null, {
|
|
100
100
|
status: 302,
|
|
101
101
|
headers: {
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/http",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.28-alpha-20221007102823-ef81a4541",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "*"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@graphql-mesh/cross-helpers": "0.2.6",
|
|
10
|
-
"@graphql-mesh/runtime": "0.44.
|
|
11
|
-
"@graphql-mesh/types": "0.84.
|
|
12
|
-
"@graphql-mesh/utils": "0.41.
|
|
10
|
+
"@graphql-mesh/runtime": "0.44.20-alpha-20221007102823-ef81a4541",
|
|
11
|
+
"@graphql-mesh/types": "0.84.10-alpha-20221007102823-ef81a4541",
|
|
12
|
+
"@graphql-mesh/utils": "0.41.21-alpha-20221007102823-ef81a4541",
|
|
13
13
|
"@whatwg-node/fetch": "^0.4.6",
|
|
14
14
|
"@whatwg-node/server": "^0.4.10",
|
|
15
15
|
"graphql-yoga": "3.0.0-next.3",
|