It is a URL shortener to get shortened URLs.
- Heroku(Hosting)
- MongoDB(Database)
- NodeJS(Serving HTML files and API)
A youtube tutorial here: SLICER | Easiest URL Shortener - Kaan Ersoy
$ git clone https://github.com/kaanersoy/slicer-fun.git
$ cd projectpath && npm install
DB_URL=example.url
PORT=1523
# for developer mode
$ npm run dev
# for production mode
$ npm run start
API URI: https://www.slicer.fun
slug
is optional, you can generate random slugs if you don't send slug.
Example Request:
fetch('https://www.slicer.fun/url', {
method: 'POST',
headers: {
headers: {
'Content-Type': 'application/json'
},
}
body: JSON.stringify({
url: 'https://google.com',
slug: 'google' // optional
})
})
Response:
{
"_id": "60ab36s7b1ee4cc2dd9e3b576",
"url": "https://google.com",
"slug": "google"
}
Just do a simple get request from client.
Example:
https://slicer.fun/:slug