1
0
This commit is contained in:
Zef Hemel 2022-09-13 08:57:04 +02:00
parent 43b5f62210
commit c80342417c
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
const { resolve } = require("path");
const { readdir } = require("fs").promises;
const mime = require("mime-types");
async function getFiles(dir) {
const dirents = await readdir(dir, { withFileTypes: true });
@ -19,6 +20,8 @@ getFiles(rootDir).then((files) => {
.map((file) => ({
name: file.substring(rootDir.length + 1),
lastModified: 0,
contentType: mime.lookup(file),
size: 0,
perm: "rw",
}))
.filter((pageMeta) => !pageMeta.name.startsWith("."));

View File

@ -1,3 +1,3 @@
/page /index.json 200
/page/* /empty.md 200
/fs /index.json 200
/fs/* /empty.md 200
/* /index.html 200