Git Product home page Git Product logo

generator-vercel-shortener's Introduction

generator-vercel-shortener

Generator to create your own personal url shortener to deploy to Vercel (formerly Zeit Now).

version downloads GitHub Workflow Status MIT License PRs Welcome Semantic Release Commitizen friendly

Getting Started

These aren't prerequisites but before you're able to actually deploy your url shortener you should:

  1. Create a Vercel account.
  2. Set up Vercel GitHub Integration. This way Vercel deploys automatically for you.
  3. Buy, migrate or simply point a domain you already own to Vercel's dns.

You don't technically need to have a domain. By default your new project in Vercel will be deployed with a domain like https://my-url-shortener.vercel.app, and your redirects will work just fine. However part of the glory of url shorteners is that they create short urls that are easy to type and remember!

Installation

npm install -g yo generator-vercel-shortener

Usage

yo vercel-shortener

By default it will look to generate in your current working directory. If that's not what you want, then specify the directory in the call or create a new directory to run the generator in.

yo vercel-shortener [<project-directory>]

or...

mkdir <project-directory>
cd <project-directory>
yo vercel-shortener

After you generate

Next steps after generating:

  1. Create a repository for your url shortener, https://github.com/new.
  2. Run git remote add origin <repo_url>.
  3. Run git push origin main.
  4. Run git branch -u origin/main.
  5. Run vercel to setup & deploy your project to Vercel.
  6. Add redirects:
    • Run shorten <destination> [<source>]. The generator will expose a globally available script for you. Run this from anywhere in your terminal. See vercel-redirects for the full cli documentation.
    • Run npm run shorten <destination> [<source>] from the root of the project.
    • Add them in vercel.json manually. You'll need to commit and push them yourself.

For example:

shorten https://gist.github.com/codfish/91ef26f3a56a5c5ca0912aa8c0c5c020 /linting

And in about ~5 seconds I can hit codfi.sh/linting and it will redirect for me.

Related Projects

  • codfi.sh - My own personal url shortener, using the same configuration as a project built with this generator.
  • vercel-redirects - Command-line utility to manage your Vercel project redirects.
  • netlify-shortener - Your own free URL shortener with Netlify (different serverless platform).

generator-vercel-shortener's People

Contributors

codfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.