Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting a quick start for developers #476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@ node_modules/
# HF config files
/dist
debug

#OSX
.DS_Store
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
17 changes: 17 additions & 0 deletions examples/front-proxy-EchoApi/apis/example.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}