Simple REST API to searching MIME types.
This API is created in Node.js - using Express.js framework and SQLite database.
First, you should clone this repository, then install all required dependencies by using npm install or yarn install. If all packages will be installed run server by npm start or yarn start. By default API should be exposed on port 3000. You can change it by defining your .env file with PORT={YOUR_NUMBER} entry.
API provides two routes - to getting MIME types by extensions and conversely - to getting extensions by MIME types.
Return all extensions with assign corresponding MIME type.
{
...
"jpg": "image/jpeg",
"jpeg": "image/jpeg",
"png": "image/png",
"gif": "image/gif"
...
}Return specified extensions with assign corresponding MIME type.
{
"jpg": "image/jpeg",
"png": "image/png"
}Return all MIME types with assign corresponding extensions.
{
...
"image/jpeg": [
"jpg",
"jpeg"
],
"image/png": [
"png"
],
"image/gif": [
"gif"
]
...
}Return specified MIME types with assign corresponding extensions.
{
"image/jpeg": [
"jpg",
"jpeg"
],
"image/png": [
"png"
]
}List of MIME types based on MDN article.
MIT