Microservice node API featuring NextJs and mongoDB to shorten long url
- clone this repository
git clone https://github.com/robdll/short-url
- move to the project directory and install dependecies
cd short-url
yarn
- run locally
yarn dev
- visit http://localhost:3000 with your browser to see the result.
<projecturl>
/api/shorturl
json object containing the following key/value
url
: a valid url
example: { url: "https://www.google.com" }
json object containing the following key/value
original_url
: original user url
short_url
: id of the url
{
"original_url":"www.google.com",
"short_url": 650
}
Short url can is now available via GET request to the url [projectURL]/api/shorturl/10
The easiest way to deploy your Next.js app is to use the Vercel Platform
Check out Next.js deployment documentation for more details.