- It is based on ngrok.
- Unlike ngrok where logs are ephemeral, it can persist logs in local file system.
- Ngrok account
- docker for mac
- jq (optional)
For mac, need to make sure nfs is ready to use.
Copy .env.example to .env, and replace your_auth_key with authentication key of your Ngrok account.
Run the command below.
./run.shAnd you will get the results as below:
// If you have jq installed, you can get the callback URL directly.
$ ./run.sh
Creating network "dynamic-callback-url_callbacknet" with the default driver
Creating dynamic-callback-url_ngrok_1 ... done
Creating dynamic-callback-url_app_1 ... done
Do you have jq installed? [y/n]: y
Callback URL:
https://caf68ba7f2ed.ngrok.io/callback/
// Else you need to vist http://localhost:4040 to get the callback URL.
// And you have to manually add /callback/ at the end of the callback URL.
$ ./run.sh
Creating network "dynamic-callback-url_callbacknet" with the default driver
Creating dynamic-callback-url_ngrok_1 ... done
Creating dynamic-callback-url_app_1 ... done
Do you have jq installed? [y/n]: n
You can visit http://localhost:4040 to get your callback url...
curl -X POST -H "Content-Type: application/json" -d '{"count":5}' \
https://caf68ba7f2ed.ngrok.io/callback/test1Callback is recorded in log/callback_test1.log.
2020/08/17 03:43:40 {"count":5}
curl -X POST -H "Content-Type: application/json" -d '{"count":5}' \
https://caf68ba7f2ed.ngrok.io/callback/test1/innerTestCallback is recorded in log/callback_test1_innerTest.log.
2020/08/17 03:45:00 {"count":5}
curl https://caf68ba7f2ed.ngrok.io/callback/test1/innerTest?param1=123¶m2=abcCallback is recorded in log/callback_test1_innerTest.log.
2021/04/13 07:11:45 param1=123¶m2=abc
After you done the callback testing, you can shut it down by running the command as below.
./down.sh