https://github.com/beaglefoot/fcc-url-shortener
https://github.com/beaglefoot/fcc-url-shortener
ejs express mongodb mongoose rest
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/beaglefoot/fcc-url-shortener
- Owner: Beaglefoot
- Created: 2018-04-22T17:19:01.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-07T17:32:52.000Z (almost 7 years ago)
- Last Synced: 2025-02-03T23:54:43.107Z (3 months ago)
- Topics: ejs, express, mongodb, mongoose, rest
- Language: JavaScript
- Homepage: https://fcc-url-shortener-bf.glitch.me/
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# URL Shortener Microservice
The third project in API section on [freeCodeCamp](https://www.freecodecamp.org/challenges/url-shortener-microservice).
### The user stories are:
* I can pass a URL as a parameter and I will receive a shortened URL in the JSON response.
* If I pass an invalid URL that doesn't follow the valid http://www.example.com format, the JSON response will contain an error instead.
* When I visit that shortened URL, it will redirect me to my original link.### Examples of usage:
#### Shortened link creation:
Input
```
curl -X POST 'https://fcc-url-shortener-bf.glitch.me/shorten' -d '{ "url": "http://yandex.ru" }' -H 'Content-Type: application/json'
```Output
```
{"shortenedUrl":"https://fcc-url-shortener-bf.glitch.me/b00nzpd"}
```#### Redirection:
Input
```
curl -X GET 'https://fcc-url-shortener-bf.glitch.me/b00nzpd'
```Output
```
Found. Redirecting to http://yandex.ru
```