This tiny app permanently redirects an old URL domain to a new one. The most useful use-case is when updating the "domain" of an app.
Let the old URL be http://old-domain.com
and the NEW_BASE_URL
environmental
variable equals to http://new-shinny-domain.com
When request the following:
GET /foo/bar?param=value
Host: old-domain.com
It should respond with:
HTTP/1.1 301 Moved Permanently
Location: http://new-shinny-domain.com/foo/bar?param=value
- Copy
.sample.env
to.env
- Run
npm i
to install development dependencies - Run
npm start
to run the server - Run
npm test
to run functional tests
If you want to contribute you can:
- Submit an issue to this repo
- Open a new PR agains
master
branch
If you find any security concer, please open an issue and tag it with security
label.