@@ -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