yungkei / yhttpcmd

yhttpcmd is a tiny cmd2http(convert command as http service) server, used to execute local commands via http.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yhttpcmd

Software License Release Docker

yhttpcmd is a tiny cmd2http(convert command as http service) server, used to execute local commands via http.

Install

There are various ways of installing yhttpcmd.

Go

go install github.com/yungkei/yhttpcmd@master

Docker Images

Docker images are available on Docker Hub.

You can launch a yhttpcmd container for trying it out with

docker run --name yhttpcmd -d -p 8080:8080 yungkei/yhttpcmd

yhttpcmd will now be reachable at http://localhost:8080/.

It is worth noting that, yhttpcmd only converts the commands set in the configuration into HTTP services.

Usage

Linux/Windows/MacOS

yhttpcmd start --config=yhttpcmd.yaml

Docker

FROM yungkei/yhttpcmd
# overwrite default configuration file
COPY yhttpcmd.yaml /yhttpcmd/yhttpcmd.yaml
CMD [ "./yhttpcmd","start" ]

Configuration

server:
  port: 8080
command_configs:
  - command: echo
    route: echo
  - command: <cmd>
    route: <route>

Execute commands via HTTP

curl -H "Content-Type:application/json" -d "{\"args\":\"hello\"}" -X POST 127.0.0.1:8080/echo
{"Command":"/bin/echo hello","Message":"hello\n"}

License

Apache License 2.0, see LICENSE.

About

yhttpcmd is a tiny cmd2http(convert command as http service) server, used to execute local commands via http.

License:Apache License 2.0


Languages

Language:Go 100.0%