Web server providing API endpoint that can be used to execute a process and respond back with expected output.
Download
Source code
Limitations
- Some file changes might not be tracked, requiring server restart
- "index.html" is always generated for hosted content and should not be modified manually
- Template file and markdown index files cannot be served on a webpage directly.
Requirements
- Java Runtime Environment, version 17 or later
Usage
java -jar proc2apiws.web.jar --configPath [CONFIG_PATH]
Options
-pt, --configPath [CONFIG_PATH] - Path of configuration JSON file
Example
With following configuration JSON file named config.json in same folder as program file:
{
"port": 8080,
"host": "127.0.0.1",
"pathRestrict": "./",
"command": ["$currentJava$","-jar","./example.jar"],
"parameters": [
{ "form": "parameter", "process": "--parameter" }
],
"outputType": "string",
"outputFilename": "output.txt",
"outputContentType": "text/txt",
"serverName": "example.kobalt.dev",
"serverLocation": "/submit/"
},
{
"port": 8081,
"host": "127.0.0.1",
"pathRestrict": "./",
"command": ["$currentJava$","-jar","./sample.jar"],
"parameters": [
{ "form": "input", "stdin": true }
],
"outputType": "binary",
"outputFilename": "$originalFilename$.zip",
"outputContentType": "application/zip",
"serverName": "sample.kobalt.dev",
"serverLocation": "/submit/"
}
]
The following command will start two servers running at ports 8080 and 8081, providing single endpoint for each at "/submit/" path:
java -jar proc2apiws.web.jar --configPath "./config.json"
Note: Check the source code for configuration file information.
License
This program is licensed under AGPL-3.0-only.