https://github.com/sub-dev/freecodecamp_metricimpconverter
https://github.com/sub-dev/freecodecamp_metricimpconverter
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/sub-dev/freecodecamp_metricimpconverter
- Owner: Sub-Dev
- Created: 2025-01-30T18:13:58.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-31T18:09:47.000Z (over 1 year ago)
- Last Synced: 2025-12-30T14:35:55.107Z (5 months ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 📏 Conversor Imperial-Métrico
Este é um projeto de conversor de unidades entre o sistema imperial e o sistema métrico, desenvolvido para a certificação de Controle de Qualidade do FreeCodeCamp.
## 📌 Funcionalidades
- âś… ConversĂŁo entre diversas unidades de medida
- ✅ Identifica entradas válidas e inválidas
- âś… Responde com JSON contendo os valores convertidos
- âś… API desenvolvida com Express.js
- ✅ Testes unitários e funcionais com Mocha e Chai
## 🚀 Tecnologias Utilizadas




## đź“‚ Estrutura do Projeto
```
boilerplate-project-metricimpconverter/
│-- controllers/
│ ├── convertHandler.js # Lógica principal de conversão
│-- tests/
│ ├── 1_unit-tests.js # Testes unitários
│ ├── 2_functional-tests.js # Testes funcionais
│-- server.js # Configuração do servidor Express
│-- README.md # Documentação do projeto
│-- package.json # Dependências e scripts
```
## đź”§ Como Executar o Projeto
1. Clone o repositĂłrio:
```sh
git clone https://github.com/Sub-Dev/freecodecamp_metricimpconverter.git
```
2. Instale as dependĂŞncias:
```sh
npm install
```
3. Inicie o servidor:
```sh
npm start
```
O servidor rodará em `http://localhost:3000`.
## đź§Ş Como Rodar os Testes
Para executar os testes unitários e funcionais, utilize:
```sh
npm test
```
## 🖥️ Endpoints da API
### 📌 `GET /api/convert?input={valor}{unidade}`
**Exemplo de uso:**
```
/api/convert?input=10L
```
**Resposta JSON:**
```json
{
"initNum": 10,
"initUnit": "L",
"returnNum": 2.64172,
"returnUnit": "gal",
"string": "10 liters converts to 2.64172 gallons"
}
```
## 📜 Licença
Este projeto segue a licença MIT.
---
Feito com đź’™ para o FreeCodeCamp!
# Metric-Imperial Converter
This is the boilerplate for the Metric-Imperial Converter project. Instructions for building your project can be found at https://www.freecodecamp.org/learn/quality-assurance/quality-assurance-projects/metric-imperial-converter