/URL-Shortie

A simple URL Shortener 🔗 written in Node JS and Vue 😌✨

Primary LanguageJavaScript

URL-Shortie 🔗✨

A simple URL Shortener made with Node JS and React

Setting up

Requirements

Downloading/cloning the project

To clone this repository make sure you have git installed. Otherwise you can use wget.
Using git:

git clone https://github.com/TheChicken14/URL-Shortie.git

Using wget:

wget https://github.com/TheChicken14/URL-Shortie/archive/master.zip

Installing

Linux/macOS/Bash

If you're on Linux, macOS or a bash shell, you can simply run the install.sh script. This script will also configure it for you.

# Make it executable
$ chmod +x ./install.sh
$ ./install.sh

Windows

If you're on windows you can do it like so:

# NPM
npm run setup
# Yarn
yarn setup
UI
# NPM
npm run build
# Yarn
yarn build
Configuration
Warning: the install script automatically does this for you!

Rename config.example.json to config.json. Then paste your MongoDB URI into the mongouri value. Make sure it ends with the database name. Here is en explanation of each key in the config:

{
  "web": {
    "port": 8888 // Port for webserver
  },
  "db": {
    "mongouri": "" // MongoDB Database URI
  },
  "secret": "your-secret", // Secret for JWT Token (change to something random)
  "proxy": false,// Set to true if using URL-Shortie behind a reverse proxy
  "dev": false // Set to true if working with development env
}

Updating

If you're on macOS or Linux, updating is really easy. Just run the update.sh script and it'll pull the new code and rebuild the UI.

Usage

To start the server, run npm start server. Now open up a browser and visit the ip of the server followed by a : and the port of URL-Shortie that you set in the config.