A lightweight and easy-to-use file storage for local development and testing environments.
-
Clone the Repository: Clone this repository to your local machine.
-
Start the Application:
- Using PNPM:
pnpm start
- Using Docker:
Note: You can change the local storage location by editing the
docker-compose up
docker-compose.yml
file. By default, files are stored in the./storage
directory at the project root.
- Using PNPM:
To modify default settings like PORT
(default: 9009), create a .env
file in the project's root. Use .env.example
as a reference for setting environment variables.
- Endpoint:
POST /
- Request Type:
multipart/form-data
- Request Body:
file
: The file blob to be uploaded.
- Success Response:
type File = { id: string; // Unique id generated by nanoid for retrieval name: string; // Original filename (sanitized and trimmed) mimeType: string; // Media type of the file, e.g., `image/png` size: number; // File size in bytes }
- Endpoint:
GET /:id
- Success Response: A blob with Content-Type set to the file's MIME type. Includes Content-Disposition for the id
- Endpoint:
GET /
- Success Response:
type FilesEntity = { files: File[] }
- Endpoint:
DELETE /:id
- Success Response: 204 Http code