- frontend https://url-tiny.netlify.app/
- backend https://url-6huw.onrender.com
You can Short your url, you can add custom length and you can add desired alias or name to url
-
Clone the repository:
git clone https://github.com/eraltafs/urlshortner
Before running the application, make sure you have the following installed:
- Node.js
- MongoDB
cd .\server\
npm install
- create .env file in server and make two variables
- mongoURL = "<your_mongo_DB_url>"
- PORT = <Your_Port_Number>
npm start
The server will start running on the specified port.
* method : GET
* Endpoint : /
* Response:
data: { msg: "Base Api" }
method: "POST",
* Endpoint : /shortUrl
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
url: <Original_URL>,
length: <length>,
alias: <custom_alias>,
}),
* Response:
data: { short_url: shortenUrl }
method: "GET",
* Endpoint : /:randomstring
* Response:
redirected if shorturl find
- let api = "https://<your_api>.com";