Git Product home page Git Product logo

go's Introduction

LinkyLinky screengrab

LinkyLinky

A little URL shortener of your own.

Example

linkylinky.netlify.com

Description

This site provides a simple short URL generator for you to host on you own domain. It is not optimized for giant sites or commercial use, but would most likely be best suited for personal use or as an addition to a company site who might be generating a few hundred, or a few thousand short urls.

The redirect rules it generates will be created on Netlify's intelligent CDN and so should be very fast at access time. The generation of new shortcodes will use a static site generation build step to populate and deploy a Netlify _redirects file.

Any server side logic for the creation of unique shortcodes will take place in an AWS Lambda which will be created and managed from within Netlify thanks to Netlify Functions.

Get your own

You can clone this repo to your own github account and create a new site on Netlify to make your own by clicking the Deploy to Netlify button below.

Deploy to Netlify

After you have create a news site on Netlify via the button above, you will then need to perform the configuration steps below.

Configuration

1. Environment variables

Before you can start using the URL shortener, you'll need to tell your build script where it can find your data. We'll make use of Netlify's form handling and access the content via the provided API.

To do this we'll need to define the following Environment Variables:

  • ROUTES_FORM_ID : The ID of the form in your Netlify site which contains all of your active routes (Discover this from the URL of your Routes form in your Forms admin page)
  • API_AUTH : Your netlify API authentication token. This will let your build script access the routes stored in your form programmatically. (Create one at https://app.netlify.com/account/applications)

2. Build hooks

In order to add new redirect rules to the Netlify CDN, we'll need to rebuild and deploy the site when we have a new route. This is done by creating a build hook and then calling it whenever a new submission is posted to the Routes form.

go's People

Contributors

philhawksworth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.