{"id":13522678,"url":"https://github.com/Ealenn/Echo-Server","last_synced_at":"2025-03-31T23:32:09.881Z","repository":{"id":39925593,"uuid":"222941965","full_name":"Ealenn/Echo-Server","owner":"Ealenn","description":"REST Server Tests (Echo-Server) API / Docker / Kubernetes / Helm","archived":false,"fork":false,"pushed_at":"2025-03-25T22:46:42.000Z","size":956,"stargazers_count":291,"open_issues_count":25,"forks_count":57,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T06:09:11.986Z","etag":null,"topics":["dev-tools","devops-tools","docker","echo","echo-server","helm","helm-charts","kubernetes","nodejs","rest-api","server","testing"],"latest_commit_sha":null,"homepage":"https://ealenn.github.io/Echo-Server","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ealenn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-20T13:18:59.000Z","updated_at":"2025-03-24T23:09:32.000Z","dependencies_parsed_at":"2023-11-16T06:22:46.402Z","dependency_job_id":"c9443200-bfad-419a-b7f2-295f6c08820a","html_url":"https://github.com/Ealenn/Echo-Server","commit_stats":null,"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ealenn%2FEcho-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ealenn%2FEcho-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ealenn%2FEcho-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ealenn%2FEcho-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ealenn","download_url":"https://codeload.github.com/Ealenn/Echo-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246558108,"owners_count":20796696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dev-tools","devops-tools","docker","echo","echo-server","helm","helm-charts","kubernetes","nodejs","rest-api","server","testing"],"created_at":"2024-08-01T06:00:51.063Z","updated_at":"2025-03-31T23:32:04.869Z","avatar_url":"https://github.com/Ealenn.png","language":"JavaScript","readme":"# Echo-Server / Docker / Kubernetes / Helm\n\n[![Codecov](https://img.shields.io/codecov/c/github/ealenn/echo-server?style=for-the-badge\u0026logo=codecov)](https://codecov.io/gh/Ealenn/Echo-Server)\n[![CodeFactor Grade](https://img.shields.io/codefactor/grade/github/ealenn/echo-server?style=for-the-badge)](https://www.codefactor.io/repository/github/ealenn/echo-server)\n[![GitHub stars](https://img.shields.io/github/stars/Ealenn/Echo-Server?style=for-the-badge\u0026logo=github)](https://github.com/Ealenn/Echo-Server/stargazers)\n[![GitHub issues](https://img.shields.io/github/issues/Ealenn/Echo-Server?style=for-the-badge\u0026logo=github)](https://github.com/Ealenn/Echo-Server/issues)\n[![DockerHub](https://img.shields.io/docker/pulls/ealen/echo-server.svg?style=for-the-badge\u0026logo=docker)](https://hub.docker.com/repository/docker/ealen/echo-server)\n[![DockerHub](https://img.shields.io/badge/SIZE-%3C%2030%20MB-1488C6?style=for-the-badge\u0026logo=docker)](https://hub.docker.com/repository/docker/ealen/echo-server)\n\n\u003e Read the docs : [https://ealenn.github.io/Echo-Server](https://ealenn.github.io/Echo-Server)\n\nAn echo server is a server that replicates the request sent by the client and sends it back.\n\nAvailable:\n\n![](https://img.shields.io/badge/linux-amd64-blue?style=flat-square\u0026logo=docker)\n![](https://img.shields.io/badge/linux-arm/v6-blue?style=flat-square\u0026logo=docker)\n![](https://img.shields.io/badge/linux-arm/v7-blue?style=flat-square\u0026logo=docker)\n![](https://img.shields.io/badge/linux-arm64/v8-blue?style=flat-square\u0026logo=docker)\n![](https://img.shields.io/badge/linux-ppc64le-blue?style=flat-square\u0026logo=docker)\n![](https://img.shields.io/badge/linux-s390x-blue?style=flat-square\u0026logo=docker)\n\n- GET / POST / PUT / PATCH / DELETE\n- Request (Query, Body, IPs, Host, Urls...)\n- Request Headers / Response Headers\n- Environment variables\n- Control via Headers/Query\n- Folders and Files\n- Monitoring\n\n![docker](https://ealenn.github.io/Echo-Server/assets/images/docker.png)\n\n## \u003ca name='Tableofcontents'\u003e\u003c/a\u003eTable of contents\n\n\u003c!-- vscode-markdown-toc --\u003e\n- [Echo-Server / Docker / Kubernetes / Helm](#echo-server--docker--kubernetes--helm)\n\t- [\u003ca name='Tableofcontents'\u003e\u003c/a\u003eTable of contents](#table-of-contents)\n\t- [\u003ca name='Configuration'\u003e\u003c/a\u003eConfiguration](#configuration)\n\t- [\u003ca name='UseEcho-Server'\u003e\u003c/a\u003eUse Echo-Server](#use-echo-server)\n\t\t- [\u003ca name='Customresponses'\u003e\u003c/a\u003eCustom responses](#custom-responses)\n\t\t\t- [\u003ca name='CustomHTTPStatusCode'\u003e\u003c/a\u003eCustom HTTP Status Code](#custom-http-status-code)\n\t\t\t- [\u003ca name='CustomBody'\u003e\u003c/a\u003eCustom Body](#custom-body)\n\t\t\t- [\u003ca name='CustomBodywithEnvironmentvariablevalue'\u003e\u003c/a\u003eCustom Body with Environment variable value](#custom-body-with-environment-variable-value)\n\t\t\t- [\u003ca name='CustomHeaders'\u003e\u003c/a\u003eCustom Headers](#custom-headers)\n\t\t\t- [\u003ca name='Customresponselatency'\u003e\u003c/a\u003eCustom response latency](#custom-response-latency)\n\t\t\t- [\u003ca name='FileFolderexplorer'\u003e\u003c/a\u003eFile/Folder explorer](#filefolder-explorer)\n\t\t\t- [\u003ca name='Combinecustomactions'\u003e\u003c/a\u003eCombine custom actions](#combine-custom-actions)\n\t- [\u003ca name='ChangedefaultQueriesRequestcommands'\u003e\u003c/a\u003eChange default Queries/Request commands](#change-default-queriesrequest-commands)\n\t- [\u003ca name='Loggers'\u003e\u003c/a\u003eLoggers](#loggers)\n\t\t- [\u003ca name='Format'\u003e\u003c/a\u003eFormat](#format)\n\t\t- [\u003ca name='Seq'\u003e\u003c/a\u003eSeq](#seq)\n\t\t- [\u003ca name='ELK'\u003e\u003c/a\u003eELK](#elk)\n\t- [\u003ca name='Settingup'\u003e\u003c/a\u003eSetting up](#setting-up)\n\t\t- [\u003ca name='Docker'\u003e\u003c/a\u003eDocker](#docker)\n\t\t- [\u003ca name='Docker-Compose'\u003e\u003c/a\u003eDocker-Compose](#docker-compose)\n\t\t- [\u003ca name='Kubernetes'\u003e\u003c/a\u003eKubernetes](#kubernetes)\n\t\t- [\u003ca name='KuberneteswithHelm'\u003e\u003c/a\u003eKubernetes with Helm](#kubernetes-with-helm)\n\t\t- [\u003ca name='NodeJS'\u003e\u003c/a\u003eNodeJS](#nodejs)\n\t- [\u003ca name='Contributing'\u003e\u003c/a\u003eContributing](#contributing)\n\t- [\u003ca name='Versioning'\u003e\u003c/a\u003eVersioning](#versioning)\n\t- [\u003ca name='License'\u003e\u003c/a\u003eLicense](#license)\n\t- [\u003ca name='Development'\u003e\u003c/a\u003eDevelopment](#development)\n\t\t- [\u003ca name='Documentation'\u003e\u003c/a\u003eDocumentation](#documentation)\n\t\t- [\u003ca name='Tests'\u003e\u003c/a\u003eTests](#tests)\n\t\t- [\u003ca name='Releasenotes'\u003e\u003c/a\u003eRelease notes](#release-notes)\n\t\t- [\u003ca name='UpdateHelmChart'\u003e\u003c/a\u003eUpdate Helm Chart](#update-helm-chart)\n\n\u003c!-- vscode-markdown-toc-config\n\tnumbering=false\n\tautoSave=true\n\t/vscode-markdown-toc-config --\u003e\n\u003c!-- /vscode-markdown-toc --\u003e\n\n## \u003ca name='Configuration'\u003e\u003c/a\u003eConfiguration\n\n| Environment         | Helm                           | CLI                  | Default       |\n|---------------------|--------------------------------|----------------------|---------------|\n| PORT                | service.port                   | --port               | `80`          |\n| LOGS__IGNORE__PING  | application.logs.ignore.ping   | --logs:ignore:ping   | `false`       |\n| ENABLE__HOST        | application.enable.host        | --enable:host        | `true`        |\n| ENABLE__HTTP        | application.enable.http        | --enable:http        | `true`        |\n| ENABLE__REQUEST     | application.enable.request     | --enable:request     | `true`        |\n| ENABLE__COOKIES     | application.enable.cookies     | --enable:cookies     | `true`        |\n| ENABLE__HEADER      | application.enable.header      | --enable:header      | `true`        |\n| ENABLE__ENVIRONMENT | application.enable.environment | --enable:environment | `true`        |\n| ENABLE__FILE        | application.enable.file        | --enable:file        | `true`        |\n\n## \u003ca name='UseEcho-Server'\u003e\u003c/a\u003eUse Echo-Server\n\n![curl](https://ealenn.github.io/Echo-Server/assets/images/curl.png)\n\nI use [jq](https://stedolan.github.io/jq) for nice `curl` results ;)\n\n### \u003ca name='Customresponses'\u003e\u003c/a\u003eCustom responses\n\n| Query               | Header                | Content                          | Conditions                |\n|---------------------|-----------------------|----------------------------------| ------------------------- |\n| ?echo_code=         | X-ECHO-CODE           | HTTP code `200`, `404`           | 200 \u003c= `CODE` \u003c= 599      |\n|                     |                       | `404-401` or `200-500-301`       |                           |\n| ?echo_body=         | X-ECHO-BODY           | Body message                     |                           |\n| ?echo_env_body=     | X-ECHO-ENV-BODY       | The key of environment variable  | Enable environment `true` |\n| ?echo_header=       | X-ECHO-HEADER         | Response Header `Lang: en-US`    | Enable header `true`      |\n| ?echo_time=         | X-ECHO-TIME           | Wait time in `ms`                | 0 \u003c= `TIME` \u003c= 30.000     |\n| ?echo_file=         | X-ECHO-FILE           | Path of Directory or File        | Enable file `true`        |\n\n#### \u003ca name='CustomHTTPStatusCode'\u003e\u003c/a\u003eCustom HTTP Status Code\n\n```bash\n➜ curl -I --header 'X-ECHO-CODE: 404' localhost:8080\n➜ curl -I localhost:8080/?echo_code=404\n\nHTTP/1.1 404 Not Found\n```\n\n```bash\n➜ curl -I --header 'X-ECHO-CODE: 404-300' localhost:8080\n➜ curl -I localhost:8080/?echo_code=404-300\n\nHTTP/1.1 404 Not Found\nHTTP/1.1 300 Multiple Choices\n```\n\n```bash\n➜ for i in {1..10}\n➜ do\n➜    curl -I localhost:8080/?echo_code=200-400-500\n➜ done\n\nHTTP/1.1 500 Internal Server Error\nHTTP/1.1 400 Bad Request\nHTTP/1.1 200 OK\nHTTP/1.1 500 Internal Server Error\nHTTP/1.1 200 OK\nHTTP/1.1 500 Internal Server Error\n```\n\n#### \u003ca name='CustomBody'\u003e\u003c/a\u003eCustom Body\n\n```bash\n➜ curl --header 'X-ECHO-BODY: amazing' localhost:8080\n➜ curl localhost:8080/?echo_body=amazing\n\n\"amazing\"\n```\n\n#### \u003ca name='CustomBodywithEnvironmentvariablevalue'\u003e\u003c/a\u003eCustom Body with Environment variable value\n\n```bash\n➜ curl --header 'X-ECHO-ENV-BODY: HOSTNAME' localhost:8080\n➜ curl localhost:8080/?echo_env_body=HOSTNAME\n\n\"c53a9ed79fa2\"\n```\n\n```bash\n➜ for i in {1..10}\n➜ do\n➜    curl localhost:8080/?echo_env_body=HOSTNAME\n➜ done\n\n\"c53a9ed79fa2\"\n\"f10c3af61e40\"\n\"c53a9ed79fa2\"\n\"f10c3af61e40\"\n\"c53a9ed79fa2\"\n```\n\n#### \u003ca name='CustomHeaders'\u003e\u003c/a\u003eCustom Headers\n\n```bash\n➜ curl --header 'X-ECHO-HEADER: One:1' localhost:8080\n➜ curl localhost:8080/?echo_header=One:1\n\nHTTP/1.1 200 OK\nOne: 1\n```\n\n```bash\n➜ curl --header 'X-ECHO-HEADER: One:1, Two:2' localhost:8080\n➜ curl \"localhost:8080/?echo_header=One:1,%20Two:2\"\n\nHTTP/1.1 200 OK\nOne: 1\nTwo: 2\n```\n\n#### \u003ca name='Customresponselatency'\u003e\u003c/a\u003eCustom response latency\n\n```bash\n➜ curl --header 'X-ECHO-TIME: 5000' localhost:8080\n➜ curl \"localhost:8080/?echo_time=5000\"\n\n⏳... 5000 ms\n```\n\nYou can change default validations with\n\n| ENVIRONMENT                | CLI                       | Default  |\n|----------------------------|---------------------------| ---------|\n| CONTROLS__TIMES__MIN       | --controls:times:min      | `0`      |\n| CONTROLS__TIMES__MAX       | --controls:times:max      | `60000`  |\n\n*(Latency is defined in milliseconds)*\n\n#### \u003ca name='FileFolderexplorer'\u003e\u003c/a\u003eFile/Folder explorer\n\n```bash\n➜ curl --header 'X-ECHO-FILE: /' localhost:8080\n➜ curl \"localhost:8080/?echo_file=/\"\n\n[\"app\", \"bin\", \"etc\", \"usr\", \"var\"]\n```\n\n#### \u003ca name='Combinecustomactions'\u003e\u003c/a\u003eCombine custom actions\n\n```bash\n➜ curl --header 'X-ECHO-CODE: 401' --header 'X-ECHO-BODY: Oups' localhost:8080\n➜ curl \"localhost:8080/?echo_body=Oups\u0026echo_code=401\"\n\nHTTP/1.1 401 Unauthorized\n\"Oups\"\n```\n\n## \u003ca name='ChangedefaultQueriesRequestcommands'\u003e\u003c/a\u003eChange default Queries/Request commands\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/configuration/commands.html)\n\n| Environment                        | CLI                                | Default            |\n|------------------------------------|------------------------------------|--------------------|\n| COMMANDS__HTTPBODY__QUERY          | --commands:httpBody:query          | `echo_body`        |\n| COMMANDS__HTTPBODY__HEADER         | --commands:httpBody:header         | `x-echo-body`      |\n| COMMANDS__HTTPENVBODY__QUERY       | --commands:httpEnvBody:query       | `echo_env_body`    |\n| COMMANDS__HTTPENVBODY__HEADER      | --commands:httpEnvBody:header      | `x-echo-env-body`  |\n| COMMANDS__HTTPCODE__QUERY          | --commands:httpCode:query          | `echo_code`        |\n| COMMANDS__HTTPCODE__HEADER         | --commands:httpCode:header         | `x-echo-code`      |\n| COMMANDS__HTTPHEADERS__QUERY       | --commands:httpHeaders:query       | `echo_header`      |\n| COMMANDS__HTTPHEADERS__HEADER      | --commands:httpHeaders:header      | `x-echo-header`    |\n| COMMANDS__TIME__QUERY              | --commands:time:query              | `echo_time`        |\n| COMMANDS__TIME__HEADER             | --commands:time:header             | `x-echo-time`      |\n| COMMANDS__FILE__QUERY              | --commands:file:query              | `echo_file`        |\n| COMMANDS__FILE__HEADER             | --commands:file:header             | `x-echo-file`      |\n\n## \u003ca name='Loggers'\u003e\u003c/a\u003eLoggers\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/configuration/loggers.html)\n\n| Environment                        | CLI                                | Default            |\n|------------------------------------|------------------------------------|--------------------|\n| LOGS__APP                          | --logs:app                         | `echo-server`      |\n| LOGS__LEVEL                        | --logs:level                       | `debug`            |\n| LOGS__FORMAT                       | --logs:format                      | `default`          |\n\n### \u003ca name='Format'\u003e\u003c/a\u003eFormat\n\n| LOG FORMAT        | DESCRIPTION                                                                 |\n|-------------------|-----------------------------------------------------------------------------|\n| default           | Combine `line` \u0026 `object`                                                   |\n| line              | Simple `Fri, 22 Jan 2021 10:45:20 GMT | [GET] - http://localhost:8080/path` |\n| object            | JSON `{ \"host\": {}, http: {}, request: {}}`                                 |\n\n### \u003ca name='Seq'\u003e\u003c/a\u003eSeq\n\n[Full example](https://github.com/Ealenn/Echo-Server/tree/master/docker-compose) - [Documentation](https://ealenn.github.io/Echo-Server/pages/quick-start/docker-compose.html)\n\n| Environment                        | CLI                                | Default            |\n|------------------------------------|------------------------------------|--------------------|\n| LOGS__SEQ__ENABLED                 | --logs:seq:enabled                 | `false`            |\n| LOGS__SEQ__SERVER                  | --logs:seq:server                  | ` `                |\n| LOGS__SEQ__KEY                     | --logs:seq:key                     | ` `                |\n| LOGS__SEQ__LEVEL                   | --logs:seq:level                   | `info`             |\n\n### \u003ca name='ELK'\u003e\u003c/a\u003eELK\n\n[Full example](https://github.com/Ealenn/Echo-Server/tree/master/docker-compose) - [Documentation](https://ealenn.github.io/Echo-Server/pages/quick-start/docker-compose.html)\n\n## \u003ca name='Settingup'\u003e\u003c/a\u003eSetting up\n\n### \u003ca name='Docker'\u003e\u003c/a\u003eDocker\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/quick-start/docker.html)\n\n```bash\ndocker run -p 8080:80 ealen/echo-server\n```\n\n### \u003ca name='Docker-Compose'\u003e\u003c/a\u003eDocker-Compose\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/quick-start/docker-compose.html)\n\n**Sample**\n\n```yaml\nversion: \"3\"\nservices:\n  echo-server:\n    image: ealen/echo-server\n    ports:\n      - 8080:80\n```\n\n**With Seq**\n\n```yaml\nversion: \"3\"\nservices:\n  echo:\n    image: ealen/echo-server\n    environment: \n      PORT: 80\n      LOGS__SEQ__ENABLED: \"true\"\n      LOGS__SEQ__SERVER: \"http://seq:5341\"\n    ports: \n      - 8080:80\n\n  seq:\n    image: datalust/seq\n    environment: \n      ACCEPT_EULA: \"Y\"\n    ports:\n      - 3010:80\n```\n\n### \u003ca name='Kubernetes'\u003e\u003c/a\u003eKubernetes\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/quick-start/kubernetes.html)\n\n```bash\ncurl -sL https://raw.githubusercontent.com/Ealenn/Echo-Server/master/docs/examples/echo.kube.yaml | kubectl apply -f -\n```\n\n### \u003ca name='KuberneteswithHelm'\u003e\u003c/a\u003eKubernetes with Helm\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/quick-start/helm.html) - [Artifact Hub](https://artifacthub.io/packages/helm/ealenn/echo-server)\n\n```bash\nhelm repo add ealenn https://ealenn.github.io/charts\nhelm repo update\nhelm install --set ingress.enable=true --name echoserver ealenn/echo-server\n```\n\n### \u003ca name='NodeJS'\u003e\u003c/a\u003eNodeJS\n\n[Read the docs](https://ealenn.github.io/Echo-Server/pages/quick-start/nodejs)\n\n```bash\n# Dependencies\nnpm ci\n# Run with node\nnode ./src/webserver --port 8080\n# Run with npm script\nPORT=8080 npm run start\n```\n\n---\n\n## \u003ca name='Contributing'\u003e\u003c/a\u003eContributing\n\nPlease read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## \u003ca name='Versioning'\u003e\u003c/a\u003eVersioning\n\nWe use [SemVer](http://semver.org/) for versioning.\nFor the versions available, see the [tags on this repository](https://github.com/Ealenn/Echo-Server/releases).\n\n## \u003ca name='License'\u003e\u003c/a\u003eLicense\n\nThis project is licensed under the GNU Lesser General Public License - see the [LICENSE.txt](https://github.com/Ealenn/Echo-Server/blob/master/LICENSE.txt) file for details.\n\n---\n\n## \u003ca name='Development'\u003e\u003c/a\u003eDevelopment\n\n### \u003ca name='Documentation'\u003e\u003c/a\u003eDocumentation\n\nDocker-Compose is available on `./docs` folder.\n\n```bash\ndocker compose up -d\n```\n\nThe documentation is here [localhost:4000](http://localhost:4000)\n\n### \u003ca name='Tests'\u003e\u003c/a\u003eTests\n\n```bash\nnpm ci\n# Without code coverage\nnpm run test\n# With code coverage\nnpm run test-with-coverage\n```\n\n### \u003ca name='Releasenotes'\u003e\u003c/a\u003eRelease notes\n\n```bash\ngit log --pretty=oneline\n```\n\n### \u003ca name='UpdateHelmChart'\u003e\u003c/a\u003eUpdate Helm Chart\n\n=\u003e [https://github.com/Ealenn/charts/tree/master/charts/echo-server](https://github.com/Ealenn/charts/tree/master/charts/echo-server)\n","funding_links":[],"categories":["JavaScript","Dev-Tools","👋 Introduction","testing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEalenn%2FEcho-Server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEalenn%2FEcho-Server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEalenn%2FEcho-Server/lists"}