Created
March 2, 2019 17:11
-
-
Save urielhdz/2c035f4d5156144d20d049d573cf99de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instalar express | |
// npm install express | |
// https://expressjs.com/en/starter/hello-world.html | |
const express = require('express') | |
const app = express() | |
const port = 3000 | |
app.get('/', (req, res) =>{ | |
// Twilio code | |
// Instalar twilio | |
// npm install twilio | |
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; | |
const authToken = 'your_auth_token'; | |
const client = require('twilio')(accountSid, authToken); | |
client.messages | |
.create({ | |
body: 'This is the ship that made the Kessel Run in fourteen parsecs?', | |
from: '+15017122661', | |
to: '+15558675310' | |
}) | |
.then(message => console.log(message.sid)); | |
}) | |
app.listen(port, () => console.log(`Example app listening on port ${port}!`)) | |
// DOs proyectos | |
// CLiente => Ionic | |
// Servidor => Express => localhost:3000 | |
// Si la IP no funciona, puedes usar ngrok | |
// Crear un servicio | |
// Inyectar el modulo http | |
// Con el modulo http hacer la peticion localhost:3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment