- NodeJS v12+
- MongoDB for storing the links, users and expired tokens.
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
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
If you're on windows you can do it like so:
# NPM
npm run setup
# Yarn
yarn setup
# NPM
npm run build
# Yarn
yarn build
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
}
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.
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.