Skip to content
🔥 A serverless url shortener made with Firebase
JavaScript HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Firebase URL Shortner

A serverless url shortener made with Firebase

Live Demo


Edit index.js config variables

Replace with Firebase project ID (Can be found on project dashboard)

let projectID = "fire-url"

Replace with desired Firestore collection for shortned urls to be saved

let collection = "list"

(Optional) Edit if url where urls are shortened will not be the same as the shortened url

var local = window.location.href

(Optional) Edit length of random hash

var hashLength = 5

Firestore Rules

Basic rules to allow users to shorten links.
Replace COLLECTION with the collection name used in index.js

service cloud.firestore {
  match /databases/{database}/documents {
    match /COLLECTION/{url} {
      allow read, create;
You can’t perform that action at this time.