response/lib/mime-tpyes.js

49 lines
941 B
JavaScript

//
export const CHARSET_TYPES = {
html:1,
txt:1,
css:1,
scss:1,
xml:1,
js:1,
json: 1,webmanifest:1
}
export const MIME_TYPES = {
html: 'text/html',
txt: 'text/plain',
css: 'text/css',
xml: 'text/xml',
gif: 'image/gif',
jpg: 'image/jpeg',
webp: 'image/webp',
tiff: 'image/tiff',
png: 'image/png',
svg: 'image/svg+xml',
ico: 'image/x-icon',
bmp: 'image/x-ms-bmp',
js: 'application/javascript',
json: 'application/json',
webmanifest: 'application/json',
mp3: 'audio/mpeg',
ogg: 'audio/ogg',
m4a: 'audio/x-m4a',
mp4: 'video/mp4',
webm: 'video/webm',
ttf: 'font/font-ttf',
woff: 'font/font-woff',
woff2: 'font/font-woff2',
wast: 'application/wast',
wasm: 'application/wasm',
stream: 'application/octet-stream'
}
MIME_TYPES.vue = MIME_TYPES.js
MIME_TYPES.scss = MIME_TYPES.css
MIME_TYPES.htm = MIME_TYPES.html
MIME_TYPES.jpeg = MIME_TYPES.jpg
MIME_TYPES.tif = MIME_TYPES.tiff
对Http的response进一步封装, 提供常用的API
JavaScript 100%