- Node.js v14.10.1 or greater
- Clone the repository:
git clone git@github.com:markross/LinkShortener.git
- Change to the directory
cd LinkShortener
- Run
npm install
Run ./bin/shorten <your link>
For example ./bin/shorten https://www.bbc.co.uk
Your shortened link will be displayed.
Run npm run server
This will start a server at localhost:5000 which will redirect any shortened links you have previously created.
NOTE: the server initially loads the links from a json file on startup, so if new links are added whilst the server is running, they will not work until the server is restarted.