A simple and efficient Node.js server application that facilitates file downloads from localhost. This project provides a secure way to serve and download files through a local server.
- Easy file downloading through HTTP endpoints
- CORS enabled for cross-origin requests
- Static file serving
- Health check endpoint
- Error handling for file downloads
- Node.js (v12.0.0 or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone https://github.com/yourusername/localhost-downloader.git- Navigate to the project directory:
cd localhost-downloader- Install dependencies:
npm install- Start the server:
npm start- The server will run at
http://localhost:3001
GET /download/:filename- Download a file from the public directoryGET /health- Check server health status
To download a file:
http://localhost:3001/download/example.pdf
localhost-downloader/
├── index.js # Main server file
├── public/ # Static files directory
├── package.json # Project configuration
└── README.md # Documentation
The server runs on port 3001 by default. You can modify this in the index.js file.
- Files can only be downloaded from the
publicdirectory - Basic error handling implemented
- CORS enabled for controlled access
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
Feng Liu
- file downloader
- localhost server
- Node.js
- Express
- file serving
- download manager
- local file server
⭐️ If you find this project useful, please consider giving it a star!