Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
Echo is a small web server that receives any request, logs basic parameters from it, and replies back with either the same data or a precrafted JSON response. It is meant to be used for debugging web clients and little else.
It does not have any dependency outside Crystal's standard library, so a simple
crystal build src/echo.cr inmediately after cloning should suffice.
Echo accepts a few command-line parameters, listed with
./echo -h. They're as follows:
-p PORT, --port PORT Specify port to use -c, --cors Enable CORS headers -j FILE, --json FILE Loads a JSON reply -h, --help Shows this help