{"id":23819902,"url":"https://github.com/kth/redirect-url","last_synced_at":"2026-04-13T19:32:37.035Z","repository":{"id":40415931,"uuid":"333440773","full_name":"KTH/redirect-url","owner":"KTH","description":"Simple test for redirecting web traffic.","archived":false,"fork":false,"pushed_at":"2023-09-27T04:43:12.000Z","size":678,"stargazers_count":0,"open_issues_count":10,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-07-06T09:50:31.712Z","etag":null,"topics":["docker","express","nodejs","redirect"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KTH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-27T14:07:55.000Z","updated_at":"2022-01-05T12:11:37.000Z","dependencies_parsed_at":"2023-02-10T20:16:02.800Z","dependency_job_id":null,"html_url":"https://github.com/KTH/redirect-url","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KTH/redirect-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fredirect-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fredirect-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fredirect-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fredirect-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/redirect-url/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fredirect-url/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31768637,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["docker","express","nodejs","redirect"],"created_at":"2025-01-02T07:16:21.709Z","updated_at":"2026-04-13T19:32:37.012Z","avatar_url":"https://github.com/KTH.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redirect url [![CircleCI](https://circleci.com/gh/KTH/redirect-url.svg?style=svg)](https://circleci.com/gh/KTH/redirect-url)  ![Continous Integration](https://github.com/KTH/redirect-url/actions/workflows/main.yml/badge.svg)\n\nRedirect a url to another absolute or relative url.\n\n## Examples\n\nIn these examples the redirect will listen for all requests to https://example.com/\n\n### Redirect any path to another host\n\n```bash\nTO_HOST='https://wwww.kth.se' node app.js\n```\n\nhttps://example.com/some/path/ -\u003e https://kth.se/some/path/\n\n### Redirect and replace a part of the path when redirecting\n\n```bash\nTO_HOST='https://wwww.kth.se' REPLACE_PATH=\"/some/path/\" REPLACE_PATH_WITH=\"/new/app/\" node app.js\n```\n\nhttps://example.com/some/path/index.html -\u003e https://kth.se/new/app/index.html\n\n### Redirect a path in a Traefik 2 cluster.\n\nhttps://example.com/some/path/index.html -\u003e https://kth.se/new/app/index.html\n\n```yml\nenvironment:\n  TO_HOST: \"https://www.kth.se\"\n  REPLACE_PATH: \"/some/path/\"\n  REPLACE_PATH_WITH: \"/new/app/\"\n  TEMPORARY_REDIRECT: \"true\"\n  REDIRECT_ID: \"Test-redirect added by team awesome\"\n\nlabels:\n  - \"traefik.http.routers.app1.rule=PathPrefix(`/some/`)\"\n  - \"traefik.http.services.app1.loadbalancer.server.port=80\"\n  - \"traefik.enable=true\"\n```\n\n## Configuration\n\n`curl -I https://exapmpel.com/katalog/sf1624`\n\n```bash\nx-frame-options: sameorigin\nx-kth-redirect-id: Test-redirect added by team awesome\nx-kth-redirected-by: redirect-url:0.0.16_2b06f76\n```\n\n### REDIRECT_ID\n\nAdd an enviroment variable `REDIRECT_ID` to add a HTTP header with information who/what made the redirect `x-kth-redirect-id: Ticket #1234567`.\n\n### TEMPORARY_REDIRECT\n\nThe default redirect is a **Permanent Redirect**. To make the redirect temporary set `TEMPORARY_REDIRECT=\"True\"`. Note that a temporary redirect is normally only a good thing during testing, since it messes upp your SEO score. Search crawlers does not follow _HTTP 307 Temporary Redirect_.\n\n### LOG_LEVEL\n\nThe default log level is `warning`. Posible values are INFO, DEBUG, SEVERE. Change by setting `LOG_LEVEL=\"debug\"`.\n\n### PORT\n\nThe default listen port is 80 change by setting `PORT=8080`.\n\n### Healthcheck paths\n\nA redirect has two healtchecks paths built in that are not redirected. `/_about` and `/_monitor`\nSo if your redirect-url app listens on https://example.com/ https://example.com/_monitor and https://example.com/_about will not redirect, but any other path will.\n\n## Unit tests\n\n### In Docker\n\nRun tests inside the :whale: Docker container using `npm run test-unit-in-docker`. The script build the Docker container according to _Dockerfile_ and then mounts the `/tests` catalog into it, and runs `npm test` inside the container. No dependencies other then Docker needed.\n\nRun test directly `npm install` and then `npm test` in your development setup to run unit tests.\n\n```text\n\nRedirect.\n\n    ✓ You can specify an absolute url (i.e: https://www.kth.se/my-path/) to redirect all traffic to\n    ✓ You can specify a relative url  (i.e: /my-path/) to redirect all traffic to\n\n```\n\n### Integration tests in Docker\n\nRun integration tests against the service running as a :whale: Docker container using `npm run test-integration-in-docker`. The script build the Docker container according to _Dockerfile_ and then starts another image that runs a _curl_-command against the service.\n\n### Run end-to-end integration tests locally.\n\n1. Start the service `npm run start-dev`\n2. Run `npm run test-integration`. This will run the same tests as _npm run test-integratoin-in-docker_.\n\n```text\n • Default check APPLICATION_STATUS: OK.\n • The about page should show Docker images information.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fredirect-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fredirect-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fredirect-url/lists"}