@graphql-mesh/http 0.1.11 → 0.1.12-alpha-20220914140748-9d922b7bc
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 +1 -1
package/index.js
CHANGED
|
@@ -83,13 +83,13 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, logger, rawServeConfig =
|
|
|
83
83
|
router.get('*', async (request) => {
|
|
84
84
|
const url = new URL(request.url);
|
|
85
85
|
if (url.pathname === '/' && (await utils.pathExists(indexPath))) {
|
|
86
|
-
const indexFile = await crossHelpers.fs.promises.readFile(indexPath
|
|
87
|
-
|
|
86
|
+
const indexFile = await crossHelpers.fs.promises.readFile(indexPath);
|
|
87
|
+
return new fetch.Response(indexFile, {
|
|
88
88
|
status: 200,
|
|
89
89
|
headers: {
|
|
90
90
|
'Content-Type': 'text/html',
|
|
91
91
|
},
|
|
92
|
-
})
|
|
92
|
+
});
|
|
93
93
|
}
|
|
94
94
|
const filePath = crossHelpers.path.join(baseDir, staticFiles, url.pathname);
|
|
95
95
|
if (await utils.pathExists(filePath)) {
|
package/index.mjs
CHANGED
|
@@ -79,13 +79,13 @@ function createMeshHTTPHandler({ baseDir, getBuiltMesh, logger, rawServeConfig =
|
|
|
79
79
|
router.get('*', async (request) => {
|
|
80
80
|
const url = new URL(request.url);
|
|
81
81
|
if (url.pathname === '/' && (await pathExists(indexPath))) {
|
|
82
|
-
const indexFile = await fs.promises.readFile(indexPath
|
|
83
|
-
|
|
82
|
+
const indexFile = await fs.promises.readFile(indexPath);
|
|
83
|
+
return new Response(indexFile, {
|
|
84
84
|
status: 200,
|
|
85
85
|
headers: {
|
|
86
86
|
'Content-Type': 'text/html',
|
|
87
87
|
},
|
|
88
|
-
})
|
|
88
|
+
});
|
|
89
89
|
}
|
|
90
90
|
const filePath = path.join(baseDir, staticFiles, url.pathname);
|
|
91
91
|
if (await pathExists(filePath)) {
|