Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joao-victor-dias/url-shortener
Projeto desenvolvido durante Bootcamp da @digitalinnovationone.
https://github.com/joao-victor-dias/url-shortener
dio-bootcamp mongodb node typescript
Last synced: 24 days ago
JSON representation
Projeto desenvolvido durante Bootcamp da @digitalinnovationone.
- Host: GitHub
- URL: https://github.com/joao-victor-dias/url-shortener
- Owner: joao-victor-dias
- Created: 2022-07-06T05:10:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T05:28:36.000Z (over 2 years ago)
- Last Synced: 2024-11-28T15:06:27.601Z (24 days ago)
- Topics: dio-bootcamp, mongodb, node, typescript
- Language: TypeScript
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API - URL Shortener
API desenvolvida com o intuito de gerar URLs reduzidas.## Tecnologias Utilizadas
## Rotas
- Gerar a URL reduzida => **Método POST:** '/shorten'
Exemplo:````json
Rota API: http://localhost:5000/shorten
Body:
{
"originURL": "https://www.google.com"
}
Response:
{
"hash": "BKqzALRjD",
"originURL": "https://www.google.com",
"shortURL": "http://localhost:5000/BKqzALRjD",
"_id": "62c516aed02f68f5242c473b",
"createdAt": "2022-07-06T04:59:26.091Z",
"updatedAt": "2022-07-06T04:59:26.091Z",
"__v": 0
}
````- Redirecionamento para a página utilizando a URL reduzida: **Método GET:** '/:hash'
````json
Rota API: http://localhost:5000/BKqzALRjD
````## Como utilizar o projeto:
- Clone o repositório
````cmd
git clone https://github.com/joao-victor-dias/url-shortener.git
````- Instale as dependências do projeto
````cmd
npm install
````- Configure os arquivos .env e Mongo.database.ts caso seja necessário
- Mongo DB com Docker
````
docker run -d --name mongodb -p 27017:27017 mongo
````- Inicie o Projeto
````
npm run start
````