http-echo

Version, currently master branch1 version
  • master branchlatestJan 26, 2022

gitlab.com/awesome_o/http-request-echo

A simple crystal-lang app to echo / inspect HTTP requests

1 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  http-echo:
    gitlab: awesome_o/http-request-echo
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
no constraint declared
License
MIT
Author
Matt
Targets
  • kemal-echo from kemal-echo.cr
  • http-request-echo from http-request-echo.cr

Dependencies

Runtime Dependencies

  • kemal*github: kemalcr/kemal

README

http-request-echo

logo.png

description

A simple crystal-lang app to echo / inspect HTTP requests

Inspired by https://httpbin.org/anything

local

crystal http-request-echo.cr

or

DEBUG=true crystal http-request-echo.cr

requires

  • crystal : https://crystal-lang.org

hot-reload

watches for changes in the first matched .cr file and reloads it as soon as it gets updated

sh hot-reload.sh

requires

  • entr : http://eradman.com/entrproject

update dependencies

shards install

build binary

shards build

run binary

bin/http-request-echo
mockup-http-requests

Generate configurable mockup HTTP requests w/ random query_params & payload

sh mockup-http-requests.sh

requires

  • jq : https://stedolan.github.io/jq
  • /usr/share/dict/words
  • https://random-data-api.com

tunnel

this is useful for using locally running code (or compiled binary) as a webhook receiver for instance

ngrok http 8080

or

ngrok http --log stdout --log-format json --region eu 8080  | jq -r '.url? | select( . | contains( "https://" )? )?'

requires

  • ngrok : https://ngrok.com
  • jq : https://stedolan.github.io/jq

heroku

https://http-request-echo.herokuapp.com

reference

reference docs & online playgrounds

  • bash : https://tldp.org/LDP/abs/html
  • crystal-lang : https://play.crystal-lang.org
  • heroku : https://github.com/crystal-lang/heroku-buildpack-crystal
  • jq : https://jqplay.org