Skip to content

Commit d97d46b

Browse files
committed
fix:vercel5
1 parent c53b585 commit d97d46b

File tree

3 files changed

+26
-58
lines changed

3 files changed

+26
-58
lines changed

Diff for: .vercelignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
drop_code
2+
jstest
3+
logs
4+
soft
5+
.git
6+
.idea
7+
.gitignore
8+
.env.development
9+
node_modules/
10+
对话1.txt
11+
# 忽略 .git 目录
12+
.git/
13+
14+
# 忽略 node_modules 目录
15+
node_modules/
16+
17+
# 忽略构建缓存
18+
.cache/
19+
20+
# 不忽略 README.md 文件(如果你不希望它被忽略)
21+
!README.md

Diff for: controllers/root.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@ 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-
if (process.env.VERCEL) {
12-
readmePath = path.join(options.rootDir, './public/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-
}
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;
1915
}
2016
}
2117

Diff for: public/README.md

-49
This file was deleted.

0 commit comments

Comments
 (0)