Copy API directory to root for Vercel deployment (fixed path handling)
cgen-6ff8567f480a4a2d9b583fcf86fd7bda
This commit is contained in:
parent
c7a42b0bad
commit
0c65f333e7
1 changed files with 7 additions and 5 deletions
12
copy-api.js
12
copy-api.js
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env node
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
|
|
@ -33,7 +33,9 @@ function copyDir(src, dest) {
|
|||
console.log(`Copied ${src} to ${dest}`);
|
||||
}
|
||||
|
||||
const srcApi = path.resolve(__dirname, "api");
|
||||
const destApi = path.resolve(__dirname, "..", "api");
|
||||
// Source is code/api relative to this file (__dirname is where package.json is)
|
||||
const srcApi = path.resolve(__dirname, 'code', 'api');
|
||||
// Destination is api/ at the root level
|
||||
const destApi = path.resolve(__dirname, 'api');
|
||||
|
||||
copyDir(srcApi, destApi);
|
||||
|
|
|
|||
Loading…
Reference in a new issue