@certik/skynet 0.18.2 → 0.18.4-beta
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/CHANGELOG.md +8 -0
- package/api.js +7 -5
- package/graphql.js +3 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/api.js
CHANGED
|
@@ -117,11 +117,6 @@ ${getSelectorDesc(selector)}
|
|
|
117
117
|
|
|
118
118
|
const { verbose, ...selectorFlags } = cli.flags;
|
|
119
119
|
|
|
120
|
-
// for health check
|
|
121
|
-
app.get("/", (req, res) => {
|
|
122
|
-
res.send("ok");
|
|
123
|
-
});
|
|
124
|
-
|
|
125
120
|
for (const route of routes) {
|
|
126
121
|
const method = route.method ? route.method.toLowerCase() : "get";
|
|
127
122
|
const middlewares = route.middlewares || [];
|
|
@@ -156,6 +151,13 @@ ${getSelectorDesc(selector)}
|
|
|
156
151
|
}
|
|
157
152
|
}
|
|
158
153
|
|
|
154
|
+
if (!routes.some((r) => r.path === "/" && r.method.toUpperCase() === "GET")) {
|
|
155
|
+
// for health check
|
|
156
|
+
app.get("/", (req, res) => {
|
|
157
|
+
res.send("ok");
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
159
161
|
if (beforeListen) {
|
|
160
162
|
await beforeListen({ app });
|
|
161
163
|
}
|
package/graphql.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export async function gql(url, query, variables = {}) {
|
|
4
|
-
const res = await fetch(url, {
|
|
1
|
+
export async function gql(query, variables = {}) {
|
|
2
|
+
const res = await fetch(process.env.SKYNET_GRAPHQL_ENDPOINT, {
|
|
5
3
|
method: "POST",
|
|
6
4
|
headers: {
|
|
7
|
-
"x-api-key":
|
|
5
|
+
"x-api-key": process.env.SKYNET_GRAPHQL_API_KEY,
|
|
8
6
|
"content-type": "application/json",
|
|
9
7
|
},
|
|
10
8
|
body: JSON.stringify({ query: query.trim(), variables }),
|