diff --git a/api/.gitignore b/api/.gitignore new file mode 100644 index 00000000..40b878db --- /dev/null +++ b/api/.gitignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/api/index.js b/api/index.js new file mode 100644 index 00000000..985763d4 --- /dev/null +++ b/api/index.js @@ -0,0 +1,16 @@ +const axios = require('axios'); + +(async function () { + const sms = await axios({ + url: 'https://api2.totalvoice.com.br/sms', + method: 'post', + headers: { + 'Access-Token': process.env.TOTALVOICE_API_KEY + }, + data: { + 'numero_destino': process.env.RODRIGOBRANAS_TELEPHONE, + 'mensagem': 'Inscreva-se no canal Rodrigo Branas e fique por dentro de todas as novidades do mundo da programação!' + } + }); + console.log(sms.data); +})(); \ No newline at end of file diff --git a/api/package-lock.json b/api/package-lock.json new file mode 100644 index 00000000..b7e61c81 --- /dev/null +++ b/api/package-lock.json @@ -0,0 +1,37 @@ +{ + "name": "api", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "requires": { + "follow-redirects": "1.5.10" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } +} diff --git a/api/package.json b/api/package.json new file mode 100644 index 00000000..f7f10a5f --- /dev/null +++ b/api/package.json @@ -0,0 +1,14 @@ +{ + "name": "api", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "axios": "^0.19.2" + } +}