changed readable format to json

This commit is contained in:
daniel31x13
2023-10-30 00:50:43 -04:00
parent c9c62b615b
commit ed91c4267b
4 changed files with 13 additions and 10 deletions
+6 -5
View File
@@ -12,7 +12,8 @@ type ReturnContentTypes =
| "text/plain"
| "image/jpeg"
| "image/png"
| "application/pdf";
| "application/pdf"
| "application/json";
export default async function readFile(filePath: string) {
let contentType: ReturnContentTypes;
@@ -58,8 +59,8 @@ export default async function readFile(filePath: string) {
contentType = "application/pdf";
} else if (filePath.endsWith(".png")) {
contentType = "image/png";
} else if (filePath.endsWith("_readability.txt")) {
contentType = "text/plain";
} else if (filePath.endsWith("_readability.json")) {
contentType = "application/json";
} else {
// if (filePath.endsWith(".jpg"))
contentType = "image/jpeg";
@@ -85,8 +86,8 @@ export default async function readFile(filePath: string) {
contentType = "application/pdf";
} else if (filePath.endsWith(".png")) {
contentType = "image/png";
} else if (filePath.endsWith("_readability.txt")) {
contentType = "text/plain";
} else if (filePath.endsWith("_readability.json")) {
contentType = "application/json";
} else {
// if (filePath.endsWith(".jpg"))
contentType = "image/jpeg";