Lightweight URL Shortener build with node-js.
You need to have Docker and Docker Compose installed.
- Clone this repository
git clone https://github.com/JZITNIK-github/url-shortener
- Go to the folder
cd url-shortener
- Configure your server
You need to configure your server. Config for your docker installation is here.
- Run the server in a background. If the computer reboots, the server will start automatically.
docker-compose up -d
- Clone this repository
git clone https://github.com/JZITNIK-github/url-shortener
- Go to the folder
cd url-shortener
- Install required dependencies
npm install
- Configure the config file. More info here
- Start the server
npm start
Config file is docker-compose.yml
- Setup the port You want different webserver port than you need to change setting that is a ports section.
You will probably see something like this
...
ports:
- 80:3000
...
Change that "80" in the ports section to your own port.
- Go down to environment section You will probably see somthing like this
...
environment:
urlShortenerPath: "/url"
urlShortenerPassword: "some-password"
...
Here change "some-password" to your own password. This password will be used to login to your webserver.
- And that's it! Now you can start your server with docker.
Config file is config.json
- port
This is the port of the server
- path
This is the path where will be shorted url located. If you generate some url, it will be in this folder. If you set path to "/url" the generated url will look something like this: /url/hAuBs
- password
Password is used to login to the website.