A lightweight Node.js and Express API for remotely executing batch scripts, built primarily for automation. This documentation provides an overview of the project, installation instructions, usage guidelines, and security considerations.
The script-executor is designed to enable the remote triggering of batch scripts via a RESTful API. The service offers a simple yet robust interface that can be integrated into various automation workflows. With a focus on ease of use and efficiency, this solution is ideal for systems that require centralized control over script execution.
- Remote Execution: Trigger batch scripts through HTTP requests.
- Lightweight: Minimal dependencies and a straightforward design.
- Built on Node.js & Express: Leverages popular frameworks for reliability and scalability.
- Extensible: Easily integrate and customize for advanced automation needs.
- Node.js (v12 or later)
- Express (included as a dependency)
- A Windows-based environment with support for batch script execution
- Clone the Repository
git clone https://github.com/PacificSilent/script-executor.git - Navigate to the Project Directory
cd script-executor - Install Dependencies
npm install
Adjust the configuration as needed:
- All batch configurations are done in the
scripts-config.jsonfile. - Modify
server.jsor the relevant configuration files to set up your batch script execution paths. - Configure security measures, such as authentication, to protect access to the API.
- Start the Server
npm start - API Endpoint
- Endpoint:
/execute-script - Method: POST
- Request Body Example:
{ "scriptName": "exampleScript.bat", "parameters": ["param1", "param2"] }
- Endpoint:
- Response A successful API call returns a JSON response indicating the execution status of the script.
- Input Validation: Always validate incoming parameters to prevent unauthorized script execution.
- Authentication: Implement authentication (e.g., API keys or tokens) to secure the API.
- Environment Isolation: Consider running the API within a secure, isolated environment to reduce risk.
Contributions are welcome! Please fork the repository and submit pull requests for any improvements or bug fixes. For major changes, open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
Made by Jona 😊