This commit is contained in:
mwiegand 2021-11-17 18:27:15 +01:00
parent 9e2382f337
commit 5f43f86adb
2 changed files with 8 additions and 4 deletions

View file

@ -3,17 +3,18 @@ require "kemal"
strategies_dir = ENV.fetch("STRATEGIES_DIR")
post "/:strategy" do |env|
stdout = IO::Memory.new
output = IO::Memory.new
Process.run(
"#{strategies_dir}/#{env.params.url["strategy"]}",
[
env.params.query.to_h.to_json,
env.params.json.to_json
],
output: stdout,
output: output,
error: output,
)
puts stdout.to_s
stdout.to_s
puts output.to_s
output.to_s
end
Kemal.run

View file

@ -1,3 +1,6 @@
#!/usr/bin/env sh
echo "hello world!"
echo "ohno" &1>2
echo "hello world 2!"
echo "ohno 2" &1>2