Aplicação API para disparos de SMS e Encurtador de URL usando o Gateway - Mobizon
Necessário registrar a conta no site abaixo para obter sua key:
# clone
$ git clone [email protected]:caioagiani/backend-sms.git
# abrir pasta
$ cd backend-sms
# configurar vars ambiente
$ cp .env.example .env
# instalar dependências
$ yarn install
# iniciar aplicação
$ yarn dev
- Enviar SMS:
post('/sms/create');
{
"recipient": "5511941439844",
"text": "Hello!"
}
- Encurtar link / listar links:
post('/shorts/create')
{
"data": {
"fullLink": "https://google.com.br"
}
}
post('/shorts/list')
{
"criteria": {
"status": "1",
"moderatorStatus": "1"
},
"pagination": {
"currentPage": "1",
"pageSize": "10"
},
"sort": {
"clickCnt": "DESC"
}
}
Importe as rotas no seu Insomnia.
$ jest --setupFiles dotenv/config --detectOpenHandles --forceExit
PASS __tests__/short.test.js
API Requests
✓ should send an sms (865 ms)
✓ should create a shortened link (477 ms)
✓ should list all shortened links (317 ms)
Test Suites: 1 passed, 1 total
Tests: 3 passed, 3 total
Snapshots: 0 total
Time: 2.871 s, estimated 3 s
Ran all test suites.
Done in 3.29s.
- @juan-patrick - Frontend
- @caioagiani - Backend