Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anowell/servur
Proof-of-concept web service for running other processes
https://github.com/anowell/servur
Last synced: about 2 months ago
JSON representation
Proof-of-concept web service for running other processes
- Host: GitHub
- URL: https://github.com/anowell/servur
- Owner: anowell
- Created: 2015-02-08T18:35:25.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-21T06:32:38.000Z (over 9 years ago)
- Last Synced: 2023-04-09T06:14:33.521Z (almost 2 years ago)
- Language: Rust
- Homepage:
- Size: 258 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Servur Concept
A simple server to "serve [data to] your" tool or library. Servur starts a process, pipes data into it, monitors it, and can send signals to it - all from HTTP requests.It's not particularly interesting alone, but it becomes interesting when you build a language/framework specific runner on top of this container.
[![Build Status](https://travis-ci.org/anowell/servur.svg)](https://travis-ci.org/anowell/servur)
## Servur runners
- [servur-ruby](https://github.com/anowell/servur-ruby)
- [servur-jar](https://github.com/anowell/servur-jar)## Servur API
### GET /
Simple hello to verify servur is running.#### Response:
200 (OK)
Hello from Servur----------
### GET /status
Get's the status of Servur. The response includes the configured runner and it's args, and if the runner is running, it will respond with the runner's PID.#### Response:
200 (OK)
{
"runner": "wc",
"runner_args": "-l"
"pid": 1234
}----------
### POST /run
Posts any arbitrary body that will be passed into the runner as STDIN. Returns as soon as the runner has started.TODO: The request should fail if the runner is already processing data.
#### Response:
202 (OK)
{
"message": "Running 'wc'"
}----------
### POST /signal/:signal
Signals the runner (if running) with a specifix UNIX signal. Supports term, kill, and stop.#### Response
200 (OK)
{
"message": "Successfully signaled 'wc' with SIGKILL"
}## Usage
The docker image is published to [anowell/servur](https://registry.hub.docker.com/u/anowell/servur/) on the Docker Hub.$ docker run -p 8080:8080 anowell/servur
$ curl -s localhost:8080/data -XPOST -d"
An old silent pond...
A frog jumps into the pond,
splash! Silence again.
"
wc output: 4 13 102## Building
cargo build
docker build .