Skip to content

A simple web application built with Node.js, Express, and MongoDB for you to readily get a shortened URL to use

Notifications You must be signed in to change notification settings

Unipisa/url-shortener

 
 

Repository files navigation

URL Shortener 🔗

A simple web application built with Node.js, Express, and MongoDB for you to readily get a shortened URL to use

Project First Look

Application Screen Shot

User Stories

  1. User can input a set of URL aiming to be shortened
  2. User can get a warning message for invalid URL format input
  3. User can get a set of shortened URL from the original URL provided
  4. User can copy the shortened URL to clipboard by clicking the copy button
  5. User can reset the input columns for next URL generation
  6. User can be redirected to the original URL by visiting the shortened URL

Admin Stories

  1. Admin can configure validation of URLS to restrict urls redirections. Eg:
    export URL_SHORTENER_URL_REGEXP="^https?://[^/]*.mydomain.com(/.*|)$"
    export URL_SHORTENER_URL_ERROR_MESSAGE="url must refer to mydomain.com"
    export URL_SHORTENER_QR_IMAGE="https://url.to/image.png"

see file controllers/convert.js for more configuration settings.


Installation

The following instructions will get you a copy of the project and all the setting needed to run it on your local machine.

Prerequisites

Clone

Clone this repository to your local machine

$ git clone [email protected]:Unipisa/url-shortener.git

Setup

** Install npm packages**

$ npm install

** Start a database server**

$ docker-compose up -d

** Activate the web server**

$ npm run dev

** Wait the message for successful activation**

> mongodb connected!
> App is running: https://localhost:3000

Now you may visit the application on browser at URL: http://localhost:3000

Docker

For production you can use the docker image https://hub.docker.com/r/paolini/url-shortener


FAQ


Authors

About

A simple web application built with Node.js, Express, and MongoDB for you to readily get a shortened URL to use

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 56.1%
  • Handlebars 32.6%
  • CSS 6.9%
  • Dockerfile 4.3%
  • Procfile 0.1%