[+] FileServer

[+] FileServer
This commit is contained in:
ALEXTANG
2023-04-25 15:12:28 +08:00
parent 4db58f507d
commit 1c0a570d74
15 changed files with 601 additions and 100 deletions

View File

@@ -0,0 +1,12 @@
const path = require('path');
const mime = require('mime');
const lookup = (pathName) => {
let ext = path.extname(pathName);
ext = ext.split('.').pop();
return mime.getType(ext) || mime.getType('txt');
}
module.exports = {
lookup
};