This is a simple Node.js application using the Express framework. The server serves audio files from a sounds directory. If no specific file is requested, it displays a list of all available audio files as clickable links.
- Serves static audio files from the
soundsdirectory. - Displays a dynamic HTML page with a list of available audio files when accessing
/sounds. - Clickable links allow users to play or download the audio files.
- Node.js (v14 or higher recommended)
- Clone the repository or copy the code to your local machine.
- Navigate to the project folder:
cd <project-folder>
- Install dependencies (if necessary):
npm install express
- Start the server:
node <filename>.js
- Open your browser and visit:
http://localhost:3000/sounds - You will see a list of available audio files as clickable links.
project-folder/
├── sounds/
│ ├── song1.mp3
│ ├── song2.mp3
│ └── ...
├── <filename>.js
- Place all audio files in the
sounds/directory.
Visiting /sounds will show:
Available Audio Files
- song1.mp3 (link to /sounds/song1.mp3)
- song2.mp3 (link to /sounds/song2.mp3)
- Make sure the
soundsdirectory exists and contains the audio files you want to serve. - You can modify the
PORTvariable in the code to change the server port.
Feel free to use and modify this code as needed you can tell you made enjoy lol.