A simple Node.js + Express backend that accepts a URL and determines whether it points to an image or video.
If the URL contains an image or video, the backend can download and store it locally.
Unsupported URLs return an error.
- URL validation
- Detects image or video using HTTP headers
- Downloads image/video files
- Clean folder structure
- Easy to test using Postman
- Node.js
- Express.js
- Fetch API
- CORS
project-root/
β
βββ routes/
β βββ check.js # Detects content type (image/video)
β βββ download.js # Downloads image/video
β
βββ utils/
β βββ validator.js # URL validation helper
β
βββ downloads/ # Stored downloaded files
β
βββ server.js # App entry point
βββ package.json
- only support public links.
- can'nt download you tube videos.
- the download folder must be on the root directory
- the frontend not supported currently