summaryrefslogtreecommitdiff
path: root/app/api/contracts
diff options
context:
space:
mode:
Diffstat (limited to 'app/api/contracts')
-rw-r--r--app/api/contracts/get-template/route.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/api/contracts/get-template/route.ts b/app/api/contracts/get-template/route.ts
index c987c527..ff42196f 100644
--- a/app/api/contracts/get-template/route.ts
+++ b/app/api/contracts/get-template/route.ts
@@ -12,8 +12,14 @@ export async function POST(request: NextRequest) {
{ status: 400 }
);
}
+ const isDev = process.env.NODE_ENV === 'development';
- const fullPath = path.join(process.cwd(), `${process.env.NAS_PATH}`, templatePath);
+ const fullPath =
+ isDev ?
+ path.join(process.cwd(), `public`, templatePath)
+ :
+ path.join(`${process.env.NAS_PATH}`, templatePath);
+
const fileBuffer = await readFile(fullPath);
return new NextResponse(fileBuffer, {