Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.52 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.52 KB

What is URL Shortener

This is a node.js fullstack web application that shorten long urls

Screenshot

How to install and host on your server (Ubuntu 18.04)

Install node.js if you haven't installed node.js yet

# https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs

First of all you need to download this repo

$ git clone https://github.com/claudianus/urlshortener.git
$ cd urlshortener

At this moment you must rename or copy '.env.example' file to '.env' and modify the values in the file to suit your environment

$ cp .env.example .env
$ vim .env

Then install dependencies and setup database.. You don't need to install any database server software like mysql, mariadb because this app use sqlite by default

$ npm install
$ node ace migration:run --force

and start the app (server)

# start the server but if you're in production pm2(http://pm2.keymetrics.io/) is recommended
$ npm start

That's it

Using Cloudflare CDN (Free) to cache shortend urls

Create a page rule to let cloudflare cache dynamic contents

create a page rule

benchmark result

just amazing.