A simple Node.js server that serves static content files and provides an endpoint to trigger installation scripts.
This project consists of a dual-purpose server:
- A static file server (port 8080) that serves content from a specified folder
- A script execution server (port 3000) with an endpoint
/install_xboxthat triggers a bash script
- Clone this repository
- Install dependencies:
npm installStart the server with:
npm start <content_folder_path> <install_bash_path>Where:
<content_folder_path>: Path to the folder containing static content files to be served<install_bash_path>: Path to the bash script to be executed when the installation endpoint is triggered
Example:
npm start ./public /path/to/install_script.sh-
Static Content Server:
- URL:
http://localhost:8080 - Serves all files from the specified content folder
- URL:
-
Script Execution Server:
- URL:
http://localhost:3000/install_xbox - Triggers the execution of the specified bash script when accessed
- URL:
- http-server: For serving static content
- shelljs: For executing shell commands
.
├── index.js # Main server file
├── package.json # Project configuration and dependencies
└── public/ # Example folder for static content
└── test.txt
The application accepts two command-line parameters:
- First parameter: Build content folder path
- Second parameter: Install bash file path
These parameters are described in the package.json and used in the index.js file.