yhttpcmd

command module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

README

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.

Documentation

Overview

Copyright © 2024 yungkei

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL