mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
[+] FileServer
[+] FileServer
This commit is contained in:
12
Luban/FileServer/src/mime.js
Normal file
12
Luban/FileServer/src/mime.js
Normal 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
|
||||
};
|
Reference in New Issue
Block a user