mirror of
https://github.com/Luzifer/local-functions.git
synced 2024-11-14 02:52:41 +00:00
Opposite of Cloud-Functions: Run scripts on the local machine through HTTP calls
|
||
---|---|---|
scripts | ||
go.mod | ||
go.sum | ||
LICENSE | ||
main.go | ||
README.md |
Luzifer / local-functions
local-functions
is intended as the opposite of Cloud-Functions: Run scripts on the local machine through HTTP calls.
Be aware: This will expose scripts in a certain folder on your machine. This might cause trouble for you! So you really should only expose the server on localhost and ensure nobody else is able to access the API. And never ever run this as root! (Or say good bye to your system!)
Examples
# curl -d '{"test": "foo"}' -H 'Content-Type: application/json' -X POST localhost:3000/echo
PWD=/home/luzifer/workspaces/private/go/src/github.com/Luzifer/local-functions
ACCEPT=*/*
SHLVL=1
CONTENT_TYPE=application/json
METHOD=POST
_=/usr/bin/env
=====
{"test": "foo"}