Skip to content

mrtdeh/go-command-runner-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-command-runner-api

Run command via REST API in server.

Requirements

  • go compiler v1.21

Debug

first in once you must install dependencies used in this project by:

go mod tidy

then, you can simple run API server by:

go run main.go

you can test API with test.sh script:

./test.sh

Build

build project in to bin directory:

go build -o bin

Usage

./bin/exec-api -p 9090
...

request to server for running ls / command in server:

curl -XPOST http://localhost:9090/run -d '{"cmd":"ls /"}' -H "Content-Type: application/json" 
...

About

Run command via REST API in server.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published