https://github.com/mathleite/tinyurl
https://github.com/mathleite/tinyurl
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathleite/tinyurl
- Owner: mathleite
- Created: 2023-05-30T22:58:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-30T23:52:37.000Z (about 3 years ago)
- Last Synced: 2025-02-16T13:44:34.500Z (over 1 year ago)
- Language: TypeScript
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TinyUrl
Shortener Url service is an application that receive a link and return a
_hashed_ endpoint that you can call and get access to the original link, like:
```text
given -> https://www.xpto.com/some_endpoint
return -> localhost:8080/a9dfa92a3e
|-> redirects to the given endpoint
```
___
| Technologies |
|:------------:|
| Typescript |
| Redis |
| Jest |
## Setup
### Docker
Run the following command to install the application packages
and start _tinyUrl_ service:
```shell
~$ docker-compose up --build
```
### Health-Check
You can check the application health:
```shell
curl --location 'localhost:8080/health-check'
```
## Usage
### Create a TinyUrl
Request: cURL
````shell
curl --location 'localhost:8080/shorten' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://www.google.com.br"
}'
````
Receive: Json
```json
{
"newUrl": "localhost:8080/a9dfa92a3e"
}
```
### Access TinyUrl
>Here you will receive a redirect to the original link.
Request: cURL
```shell
curl --location 'localhost:8080/a9dfa92a3e'
```
### [WIP] Tests ~