diff --git a/package.json b/package.json index 207037c..86a4714 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@arweave/gateway", - "version": "0.11.1", + "version": "0.11.2", "main": "dist/src/Gateway.js", "repository": "git@github.com:ArweaveTeam/gateway.git", "author": "Arweave ", diff --git a/src/route/data.route.ts b/src/route/data.route.ts index e97db06..e90c4d5 100644 --- a/src/route/data.route.ts +++ b/src/route/data.route.ts @@ -2,7 +2,8 @@ import {exists} from 'fs-jetpack'; import {Request, Response} from 'express'; import {stringToBip39, stringToHash} from '../utility/bip39.utility'; import {transaction as getTransaction, tagValue} from '../query/transaction.query'; -import {cacheFile, cacheAnsFile} from '../caching/file.caching'; +import {cacheFolder, cacheFile, cacheAnsFile} from '../caching/file.caching'; + export const dataRouteRegex = /^\/?([a-zA-Z0-9-_]{43})\/?$|^\/?([a-zA-Z0-9-_]{43})\/(.*)$/i; export const pathRegex = /^\/?([a-z0-9-_]{43})/i; @@ -48,9 +49,9 @@ export async function dataRoute(req: Request, res: Response) { } - if (exists(`${process.cwd()}/cache/tx/${transaction}`)) { + if (exists(`${cacheFolder}/${transaction}`)) { res.status(200); - res.sendFile(`${process.cwd()}/cache/tx/${transaction}`); + res.sendFile(`${cacheFolder}/${transaction}`); } else { res.status(500); res.json({status: 'ERROR', message: 'Could not retrieve transaction'});