Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links

Overview

rebrandly-express

Seamlessly connect your web server to Rebrandly so that you can re-use your domain name for both your app and your short links

Rebrandly innovated the way individuals and companies share links,
introducing Branded Links and providing an easy way for everyone to define meaningful links using their custom domain name.

Rebrandly embraced a mission to have you create Branded Links using the same domain name you use for your email and website, so that you are no longer supposed to dedicate an entire spare domain name to your short links: just use the .com you already have both for your website and short links!

The rebrandly-express router is a middleware you can use in your NodeJS projects using Express router,
so that you can extend your web server's routes remotely after you have deployed the app by creating new links with this domain name in your Rebrandly account.

install

> npm install rebrandly-express

How it works

Whenever your web server is unable to match the HTTP request with any defined route of your web app,
this middleware will delegate to Rebrandly the handling of the request:
If a matching Branded Link is found in your Rebrandly account, your visitor will be redirected there.

Keep your flow the same

This module is completely transparent to your existing flow and is 100% safe to add on top of what you have:
whenever it detects that there is no match neither in your app nor in Rebrandly,
your standard 404 routing will be selected as next page and your visitors will be served your 404 page as before.

Easy configuration

Subscribe to Rebrandly and connect a domain name you have, or register a new one. Make sure to turn on the "Aliasing" feature for the domain.

While adding the middleware to your web server,
configure it with the alias for your branded domain

const rebrandlyRouter = require("rebrandly-express");
const options = { "alias": "xxxxxxxxx.rebrandly.cc" };
const fallbackToRebrandly = rebrandlyRouter(options);

// init your app as usual and add your middlewares
...

// then add Rebrandly right before your latest catchall rule for 404
app.use(fallbackToRebrandly);
app.use('*', your404Handler);

Comments
  • Re-route all traffic to alias domain name through URL rewriting

    Re-route all traffic to alias domain name through URL rewriting

    Refer to https://github.com/rebrandly/rebrandly-express/wiki/URL-rewriting-and-alias-domains

    User Stories

    As a Rebrandly developer, I need the middleware to accept an alias domain name as input during its setup,
    So that I can assume the alias domain name is always known at runtime

    As a Rebrandly developer, I need the middleware to re-write the incoming HTTP request following a set of rewriting rules, So that I can make sure there is a testable module specific to URL rewriting

    Acceptance Tests

    Given a server running on domain acme.com Given that acme.com was added as an alias domain in Rebrandly Given that the alias of acme.com is xyzxyzxyz.rebrandly.cc

    Given that there is no matching route for /promo When the server running at acme.com processes https://acme.com/promo URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo When the server running at acme.com processes http://acme.com/promo URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo When the server running at acme.com processes https://acme.com/promo?super=true URL Then the response is a 302 Temporary Redirect to URL https://xyzxyzxyz.rebrandly.cc/promo?super=true

    opened by giannifiore 2
  • Init the npm module

    Init the npm module

    As a Rebrandly product owner,
    I want rebrandly-express namespace to be reserved on npm for this project, So that this name doesn't get taken by other projects during the development

    As a package contributor, I want rebrandly-express package to at least include basic middleware with no functionality, So that I can include it in my local projects and keep updating it as soon as functionalities get added

    As a Rebrandly product owner,
    I want rebrandly-express namespace to be publicly listed and associated with this public GitHub repository, So that supporters and contributors can easily access and test it

    __

    Steps:

    • init the project with a package.json file, make sure to use Rebrandly as the owner, rebrandly-express to be the package name, and the package to be marked as public and to link this repo
    • implement an empty middleware (refer to major express middleware for an idea how they are distributed and organized in structure)
    • have the first version to be v0.0.1
    • make use of Rebrandly company's npm publish credentials to publish on the public npm registry
    opened by giannifiore 1
  • Add support for verification challenge

    Add support for verification challenge

    User Stories

    As a Rebrandly engineer,
    I need to verify that a given domain connected to Rebrandly is indeed connected to Rebrandly at application layer, So that I can verify that the aliasing is active for this domain name and mark it as verified.

    Acceptance Tests

    Given a domain DOMAIN where a server using this middleware is running, When I navigate http://DOMAIN/.well-known/rebrandly route, Then I get a textual (text/html) response stating "Rebrandly was here"

    Given a domain DOMAIN where a server which is not using this middleware is running, When I navigate http://DOMAIN/.well-known/rebrandly route, Then I do not get a response stating "Rebrandly was here" (I got nothing, or something else)

    opened by giannifiore 0
  • Magic JWT verification

    Magic JWT verification

    User Stories

    As a Rebrandly developer,
    I want Rebrandly customer to copy and paste a token into their middleware configurations,
    So that I can pack multiple options and technical settings in a way that is transparent to customers

    Acceptance Tests

    [should verify that the token incorporates the alias hostname] Given a valid Rebrandly token for aliasing (a JWT), Given the middleware is set up with the token passed as option, When the server is launched, Then the token is decoded and the alias hostname is derived out of the JWT

    [should verify that the token is signed by Rebrandly] Given a valid Rebrandly token for aliasing (a JWT), Given the middleware is set up with the token passed as option, When the server is launched, Then the JWT signature is verified against the Rebrandly public key

    [should disable itself in case the token was not signed by Rebrandly] Given an invalid Rebrandly token for aliasing (a JWT), Given the middleware is set up with the token passed as option, When the server is launched Then the MW prints a warning and disables itself (no-op) in a way that the global flow continues as usual

    opened by giannifiore 0
  • Fault-tolerance

    Fault-tolerance

    User Stories

    As a web server developer,
    I want the middleware to not cause my server to crash unexpectedly,
    So that I can make sure the server tolerates Rebrandly downtimes and errors

    Acceptance tests

    [should tolerate unexpected failures and silently fallback to the basic flow] Given a router ROUTER Given that the middleware MW is installed on ROUTER,
    Given that the middleware includes a bug causing it to halt,
    Given a request REQ generally causing MW to be launched, When request REQ is processed by ROUTER,
    Then the exceptions generated in MW do not halt the global routing

    [should tolerate bad tokens] Given a router ROUTER, Given that the middleware MW is installed on ROUTER, Given that the authentication token for MW is wrong, When router is created upon server launch, Then MW would print a warning without causing the global router setup crash Then MW would produce no effects (no-op) on the global routing

    [should tolerate corrupted options] Given a router ROUTER, Given that the middleware MW is installed on ROUTER, Given that the options for MW are not consistent with supported options, When router is created upon server launch, Then MW would print a warning without causing the global router setup crash Then MW would produce no effects (no-op) on the global routing

    opened by giannifiore 0
  • No interference with existing routes

    No interference with existing routes

    User stories

    As a web server developer, I need the middleware function to never be called for HTTP requests matching existing routes,
    So that I can rest assured that it will not slow down or affect any existing flow in my app


    Acceptance tests

    [should not be executed on routes which are known to the server] Given an HTTP request REQ with HTTP verb GET and path PATH, Given an Express router ROUTER with a express routing rule RULE for pattern PATTERN matching PATH and GET verb, Given that RULE is a function which returns a response RES to the HTTP client,
    Given the rebrandly-express middleware MW is installed in ROUTER after the routing rule, Given there is no previous other express rule with a matching pattern for PATH and GET verb, When REQ is processed by ROUTER Then the ROUTER will eventually execute the function associated to RULE and return RES, Then the MW function is never executed

    [should not produce effects on routes using verbs different than GET] Given an HTTP request REQ with HTTP verb different than GET, Given an Express router ROUTER with no rules, Given the rebrandly-express middleware MW is installed in ROUTER, When REQ is processed by ROUTER Then the MW function is executed without producing any effect

    opened by giannifiore 1
HackFest is a 36-hour long hackathon wherein you have to put on your hacker hats and build anything that falls in either or both the domain of full-stack web development

HackFest is a 36-hour long hackathon wherein you have to put on your hacker hats and build anything that falls in either or both the domain of full-stack web development (the stack we learn in full-stack web developer roadmap on codedamn).

Shivam Kumar 2 Jun 6, 2022
Connect Web Integration illustrates the integration of Connect-Web in various JS frameworks and tooling

Connect Web Integration Connect Web Integration is a repository of example projects using Connect-Web with various JS frameworks and tooling. It provi

Buf 43 Dec 29, 2022
πŸ‘„ My simple worker for short links

?? My simple worker for short links I wanted a quick-and-easy way to create links on my domain, so I turned to Cloudflare Workers. All routes availabl

Paul Przybyszewski 2 Apr 15, 2022
Sharing short code samples, logs or links is now easier than ever!

Pastebin Sharing short code samples, logs or links is now easier than ever. Explore the docs Β» β€’ Report Bug β€’ Request Feature β€’ About The Project With

Prasoon Soni 4 Nov 26, 2022
Grupprojekt fΓΆr kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet fΓΆr kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide FΓΆr information om hur utv

Svante Jonsson IT-HΓΆgskolan 3 May 18, 2022
Hemsida fΓΆr personer i Sverige som kan och vill erbjuda boende till mΓ€nniskor pΓ₯ flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo fΓΆr kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Superlight vanilla javascript plugin, for modern web dropdowns. Supporting multi-options, search and images. Designed to be seamlessly themed

Superlight vanilla javascript dropdowns by LCweb Need to jump off of jQuery (or any other) dependency? Other packages are too heavy to just tweak sele

Luca 10 Dec 26, 2022
This project is created to store the name of the book and the name of its author, build with JavaScript.

awesome-books A plain javascript project that can keep track of a list of books utilizing localStorage. See live demo Built With HTML CSS Javascript T

Shaqayq Darwazi 3 Jul 19, 2022
JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

JSON Visio is data visualization tool for your json data which seamlessly illustrates your data on graphs without having to restructure anything, paste directly or import file.

Aykut Saraç 20.6k Jan 4, 2023
A build plugin to integrate Gatsby seamlessly with Netlify

Essential Gatsby Plugin This build plugin is a utility for supporting Gatsby on Netlify. To support build caching and Gatsby functions on Netlify, you

Netlify 72 Dec 27, 2022
This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do any operations that can be performed in python shell with this package.

Django execute code This is a project that is used to execute python codes in the web page. You can install and use it in django projects, You can do

Shinu 5 Nov 12, 2022
πŸ“ You Can Create Your Own Short Notes With The Help of Sticky-Notes Website.

Hi ?? , I'm Sneh Agrawal A passionate Web developer from India ?? I’m currently working on Chatting Website Chit-Chat ?? How to reach me on My Gmail A

Sneh (Smilyboyy) 1 Feb 23, 2022
On this page, you can save and load all the awesome books you have and save the name and the author into the local storage. this project uses Javascript to interact with the pages

Awesome Books: refactor to use JavaScript classes In this project, We add the links to the applications into the final project Getting Started if you

Cesar Valencia 8 Nov 29, 2022
With this script you can bypass both root detection and ssl pinning for your android app.

frida_rootansslbypas β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—

themalwarenews 14 Dec 24, 2022
may-be.gay is a service in which you can register your own sub-domain for your personal website

may-be.gay is a service in which you can register your own sub-domain for your personal website. How to register New method (Recommended) Create a new

may-be.gay 7 Dec 27, 2022
Types generator will help user to create TS types from JSON. Just paste your single object JSON the Types generator will auto-generate the interfaces for you. You can give a name for the root object

Types generator Types generator is a utility tool that will help User to create TS Interfaces from JSON. All you have to do is paste your single objec

Vineeth.TR 16 Dec 6, 2022
πŸ’» Countries Web is a web application that lets you view data for all the countries in the world and filter them by country name and continent.

?? Countries Web View Demo This is the Countries Web, a web application that lets you view data for all the countries in the world and filter them by

JoΓ£o Gabriel 5 Jun 23, 2022