This repo is an very simple react app for demonstrating the back-end URL shortener system, you should always run backend server at first.
This react app provide the following interactive functionalities to you:
- Shorten URL
- this functionality provide a GUI to you for doing the URL shortening
- Preview URL
- this functionality take the shortened URL or token then return the original URL if exists.
System Prerequisites
- git
- node v10 or latter (developed on v10.22.0)
- npm 6 or latter (developed on 6.14.6)
git clone https://github.com/hjcian/urlshortener-react
cd urlshortener-react
npm i
Prerequisites
- you should run my back-end URL shortener system demo first
npm run start
app will run on localhost:3000 by default
npm run build
npm install -g serve
serve -s build
app will run on localhost:5000 by default
The redirection function is supported by backend server.
So you could just use go to original URL by Shortened URL, e.g.:
http://127.0.0.1:12345 is the host of backend server.
You can find more details about backend API on URL Redirection - /<token>.