Skip to content

Commit ee0e8ea

Browse files
committed
Disabling download router until I figure out why Hyperdrive is broken
1 parent 1263ebd commit ee0e8ea

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "labelzoom-cf-api-proxy",
33
"description": "A Cloudflare Worker that serves as a reverse proxy for LabelZoom's public REST API",
4-
"version": "1.2.2",
4+
"version": "1.2.3",
55
"private": true,
66
"dependencies": {
77
"hono": "4.7.7",

src/worker/index.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,23 @@ app.use("/api/v2/convert/:sourceFormat/to/:targetFormat", (c, next) => {
9090
//#endregion
9191

9292
//#region Download redirects
93-
app.use("/download/*", (c, next) => {
94-
return hyperdriveMysql({
95-
config: c.env.DB,
96-
})(c, next);
97-
});
98-
app.get("/download/:version/:packageName", async (c) => {
99-
let { version, packageName } = c.req.param();
100-
if (version === 'latest') {
101-
const db = c.get('db');
102-
if (!db) throw new Error('download controller must be used with (and sequenced after) the hyperdrive middleware');
103-
const [results] = await db.query(GET_LATEST_VERSION_SQL);
104-
const rows = results as mysql.RowDataPacket[];
105-
version = `${rows[0].major}.${rows[0].minor}.${rows[0].revision}`;
106-
}
107-
return c.redirect(`${c.env.S3_BUCKET}/${version}/${packageName}`);
108-
});
93+
// TODO: Disabled temporarily until I figure out why Hyperdrive is broken
94+
// app.use("/download/*", (c, next) => {
95+
// return hyperdriveMysql({
96+
// config: c.env.DB,
97+
// })(c, next);
98+
// });
99+
// app.get("/download/:version/:packageName", async (c) => {
100+
// let { version, packageName } = c.req.param();
101+
// if (version === 'latest') {
102+
// const db = c.get('db');
103+
// if (!db) throw new Error('download controller must be used with (and sequenced after) the hyperdrive middleware');
104+
// const [results] = await db.query(GET_LATEST_VERSION_SQL);
105+
// const rows = results as mysql.RowDataPacket[];
106+
// version = `${rows[0].major}.${rows[0].minor}.${rows[0].revision}`;
107+
// }
108+
// return c.redirect(`${c.env.S3_BUCKET}/${version}/${packageName}`);
109+
// });
109110
//#endregion
110111

111112
//#region All other requests

0 commit comments

Comments
 (0)