Skip to content

Instantly share code, notes, and snippets.

@montasim
Last active June 27, 2024 17:33
Show Gist options
  • Save montasim/0ef3d98e8a6db01091f29d0e87b0eff3 to your computer and use it in GitHub Desktop.
Save montasim/0ef3d98e8a6db01091f29d0e87b0eff3 to your computer and use it in GitHub Desktop.
Defines common MIME types for use in API responses. These MIME types represent various types of content that can be served by the API. Adjust these MIME types as needed to align with the APIs content requirements.
/**
* @fileoverview Defines common MIME types for use in API responses.
* These MIME types represent various types of content that can be served by the API.
* Adjust these MIME types as needed to align with the APIs content requirements.
*
* @author Mohammad Montasim -Al- Mamun Shuvo
* @date 2024-03-03
*/
/**
* MIME Type for PDF files.
* @type {string}
*/
const MIME_TYPE_PDF = 'application/pdf';
/**
* MIME Type for JPEG images.
* @type {string}
*/
const MIME_TYPE_JPG = 'image/jpeg';
/**
* MIME Type for PNG images.
* @type {string}
*/
const MIME_TYPE_PNG = 'image/png';
/**
* MIME Type for ICO images.
* @type {string}
*/
const MIME_TYPE_ICO = 'image/x-icon';
/**
* MIME Type for MP4 videos.
* @type {string}
*/
const MIME_TYPE_MP4 = 'video/mp4';
/**
* MIME Type for JSON data.
* @type {string}
*/
const MIME_TYPE_JSON = 'application/json';
/**
* MIME Type for XML data.
* @type {string}
*/
const MIME_TYPE_XML = 'application/xml';
/**
* MIME Type for JavaScript files.
* @type {string}
*/
const MIME_TYPE_JS = 'application/javascript';
/**
* MIME Type for CSS files.
* @type {string}
*/
const MIME_TYPE_CSS = 'text/css';
/**
* MIME Type for HTML files.
* @type {string}
*/
const MIME_TYPE_HTML = 'text/html';
/**
* MIME Type for GIF images.
* @type {string}
*/
const MIME_TYPE_GIF = 'image/gif';
/**
* MIME Type for BMP images.
* @type {string}
*/
const MIME_TYPE_BMP = 'image/bmp';
/**
* MIME Type for TIFF images.
* @type {string}
*/
const MIME_TYPE_TIFF = 'image/tiff';
/**
* MIME Type for SVG images.
* @type {string}
*/
const MIME_TYPE_SVG = 'image/svg+xml';
/**
* MIME Type for MP3 audio files.
* @type {string}
*/
const MIME_TYPE_MP3 = 'audio/mpeg';
/**
* MIME Type for WAV audio files.
* @type {string}
*/
const MIME_TYPE_WAV = 'audio/wav';
/**
* MIME Type for ZIP archives.
* @type {string}
*/
const MIME_TYPE_ZIP = 'application/zip';
/**
* MIME Type for RAR archives.
* @type {string}
*/
const MIME_TYPE_RAR = 'application/vnd.rar';
/**
* MIME Type for Markdown files.
* @type {string}
*/
const MIME_TYPE_MD = 'text/markdown';
/**
* MIME Type for Plain Text files.
* @type {string}
*/
const MIME_TYPE_TXT = 'text/plain';
/**
* MIME Type for CSV files.
* @type {string}
*/
const MIME_TYPE_CSV = 'text/csv';
// Export the MIME types for use in other parts of the application
export {
MIME_TYPE_PDF,
MIME_TYPE_JPG,
MIME_TYPE_PNG,
MIME_TYPE_ICO,
MIME_TYPE_MP4,
MIME_TYPE_JSON,
MIME_TYPE_XML,
MIME_TYPE_JS,
MIME_TYPE_CSS,
MIME_TYPE_HTML,
MIME_TYPE_GIF,
MIME_TYPE_BMP,
MIME_TYPE_TIFF,
MIME_TYPE_SVG,
MIME_TYPE_MP3,
MIME_TYPE_WAV,
MIME_TYPE_ZIP,
MIME_TYPE_RAR,
MIME_TYPE_MD,
MIME_TYPE_TXT,
MIME_TYPE_CSV,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment