This repository houses a powerful file service that offers various functionalities. Below are the key features of this service:
Capture a screenshot of a website by providing the URL. Accessible through /v1/image, the system will open the specified URL, take a screenshot, and provide the image URL.
curl -X POST -H "Content-Type: application/json" -d '{"url": "https://example.com"}' http://your-service-domain/v1/imageGenerate a PDF from a given URL, similar to the screenshot feature. Accessible through /v1/pdf.
curl -X POST -H "Content-Type: application/json" -d '{"url": "https://example.com"}' http://your-service-domain/v1/pdfUpload PNG, JPG, JPEG, or SVG images using the /v1/upload endpoint. The system will compress the uploaded image into WebP format.
curl -X POST -H "Content-Type: multipart/form-data" -F "file=@/path/to/your/image.jpg" http://your-service-domain/v1/uploadConvert an image from a URL, compress it, and provide it in WebP format through the /v1/convert-image endpoint.
curl -X POST -H "Content-Type: application/json" -d '{"url": "https://example.com/image.jpg"}' http://your-service-domain/v1/convert-image- Node.js v18.17.0
- TypeScript
- HTTP (Express)
- Cloud Storage (Minio)
- Docker
-
Clone the repository:
git clone https://github.com/ayocodingit/generator-file-service.git cd generator-file-service -
Create a
.envfile based on.env.example. -
Install dependencies:
npm install
npm run start:devnpm run buildnpm startnpm run lintnpm run lint:fixnpm testdocker build -f docker/Dockerfile -t your-image-name:tag .docker run -p 3000:3000 your-image-name:tagAdjust the port mapping according to your configuration.
Feel free to explore and utilize this versatile file service for your needs!