Skip to content
/ redi Public

An Express redirect server, ready to fork and use on your domain.

License

Notifications You must be signed in to change notification settings

Helmare/redi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redi

An Express redirect server, ready to fork and use on your domain.

Setup

This repo is setup to run a redirect server right out of the box and plays well with continuous deployment services. Just fork the repo and tell your platform of choice to auto-deploy from the fork. Then update the config.toml on your fork to your specifications. An example config is provided in the configuration section.

Local Server

To run a local server, clone the forked repository and run the following commands:

npm i
npm start

Configuration

#
# Config file version.
#
version=2
#
# The "default" redirect is used as a fallback. If none is
# provided, then the server will return a standard express
# 404 response.
#
default="https://hazdryx.me"

#
# All redirects are placed here. When a server is booting up it
# will load this and create express routes based on the keys and
# redirect to the value.
#
[[redirects]]
#
# The "hostname" allows you to control on which host the redirects 
# take affect. This accepts a wildcard at the start and end of the
# hostname and defaults to "*".
#
hostname="rd.*"
#
# These are the redirects for the specified hostname.
#
"/fiverr"="https://www.fiverr.com/hazdryx"
"/fiverr-cli"="https://www.fiverr.com/hazdryx/code-a-custom-nodejs-cli"

#
# GitHub redirect example.
#
[[redirects]]
hostname="git.*"
#
# Redirects can contain a default as well and is specific to that
# host.
#
default="https://github.com/hazdryx"
#
# Using ':' creates a paramter in your URL that will be transfered
# to the redirect.
#
"/:repo"="https://github.com/hazdryx/:repo"

About

An Express redirect server, ready to fork and use on your domain.

Topics

Resources

License

Stars

Watchers

Forks