Skip to content

Commit ced875f

Browse files
committed
fix:vercel3
1 parent 87b8b97 commit ced875f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

controllers/root.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ export default (fastify, options, done) => {
77
fastify.get('/', async (request, reply) => {
88
let readmePath = null;
99
const files = readdirSync(options.rootDir);
10-
console.log(files);
11-
for (const file of files) {
12-
if (/^readme\.md$/i.test(file)) {
13-
readmePath = path.join(options.rootDir, file);
14-
break;
10+
// console.log(files);
11+
if (process.env.VERCEL) {
12+
readmePath = path.join(options.rootDir, './README.md');
13+
} else {
14+
for (const file of files) {
15+
if (/^readme\.md$/i.test(file)) {
16+
readmePath = path.join(options.rootDir, file);
17+
break;
18+
}
1519
}
1620
}
1721

0 commit comments

Comments
 (0)