From c10aa3c8f1cefa42a85fb65affeb67f518d68a85 Mon Sep 17 00:00:00 2001 From: Leonardo-Ferreira Date: Mon, 17 May 2021 15:42:04 -0300 Subject: [PATCH 1/2] Documenting a quick start for developers Documented a quick method to enable new developers to get up and running Created a simple echo api with no dependencies so enable fast debugging --- CONTRIBUTING.md | 53 +++++++++++++++++++ .../front-proxy-EchoApi/apis/example.json | 17 ++++++ 2 files changed, 70 insertions(+) create mode 100644 examples/front-proxy-EchoApi/apis/example.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 367dc557e..864c4cadb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,3 +64,56 @@ Both issue lists are sorted by total number of comments. While not perfect, numb Happy Coding from the HelloFresh Engineering team! + + +## Compiling and Debugging + +### Compiling +After cloning the solution, using the `master` branch, the code should be compiling at all times. If it's not, please file a bug. + +### Debugging +To quickly start a debug session, a simple api has been provided on the examples folder. To use it, a `janus.toml` file at root of the cloned directory and paste the following content to it and save + +``` +################################################################ +# Global configuration +################################################################ +port = 8080 + +[log] + level = "debug" + +################################################################ +# API configuration backend +################################################################ +[web] + port = 8081 + + [web.credentials] + secret = "secret" + + [web.credentials.basic] + users = {admin = "admin"} + +[database] + dsn = "file://{Path To Cloned Directory}}/examples/front-proxy-EchoApi/" +``` + +If you're using VSCode, you can use the following settings on the `launch.json`: + +``` +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch", + "type": "go", + "args": ["start"], + "request": "launch", + "program": "${workspaceFolder}" + } + ] +} +``` + +When you hit debug, the application will start, bind to port 8080. When access `http://localhost:8080/echo` you should get a echo back from the publically available postman-echo service (https://learning.postman.com/docs/developer/echo-api/). \ No newline at end of file diff --git a/examples/front-proxy-EchoApi/apis/example.json b/examples/front-proxy-EchoApi/apis/example.json new file mode 100644 index 000000000..b78acac99 --- /dev/null +++ b/examples/front-proxy-EchoApi/apis/example.json @@ -0,0 +1,17 @@ +{ + "name" : "echoApi", + "active" : true, + "proxy" : { + "preserve_host" : false, + "listen_path" : "/echo/*", + "upstreams" : { + "balancing": "roundrobin", + "targets": [ + {"target": "http://postman-echo.com/get"} + ] + }, + "strip_path" : false, + "append_path" : false, + "methods" : ["GET"] + } +} From aa9ae5450b2bcd89b9467cf5778837690cd887c0 Mon Sep 17 00:00:00 2001 From: Leonardo-Ferreira Date: Mon, 17 May 2021 15:49:33 -0300 Subject: [PATCH 2/2] Also ignoring the DS_Store for MACOSX --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index ef50a4915..7903aaaa0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,6 @@ node_modules/ # HF config files /dist debug + +#OSX +.DS_Store \ No newline at end of file