Enter a number, begins with a country code
25 | 30 |├── .gitignore ├── public ├── images │ ├── icon-nexmo.png │ ├── nexmo-white.png │ └── nexmo-sms-notification-demo.gif ├── css │ └── style.css └── js │ └── app.js ├── package.json ├── README.md ├── views └── index.html └── server └── index.js /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | config.js 4 | temp.js 5 | persist 6 | -------------------------------------------------------------------------------- /public/images/icon-nexmo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nexmo-community/send-sms-nodejs/HEAD/public/images/icon-nexmo.png -------------------------------------------------------------------------------- /public/images/nexmo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nexmo-community/send-sms-nodejs/HEAD/public/images/nexmo-white.png -------------------------------------------------------------------------------- /public/images/nexmo-sms-notification-demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nexmo-community/send-sms-nodejs/HEAD/public/images/nexmo-sms-notification-demo.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nexmo-sms-demo", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Tomomi ❤ Imura", 10 | "license": "MIT", 11 | "dependencies": { 12 | "body-parser": "^1.15.2", 13 | "ejs": "^2.5.1", 14 | "express": "^4.14.0", 15 | "nexmo": "^1.0.0-beta-7", 16 | "socket.io": "^1.4.8" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sending SMS from Web 2 | 3 | This is a simple web app written in Node.js with Express. 4 | Additionally, I am using W3C Web Notifications API for the front-end UI to show the SMS receipt message with Socket.io. 5 | 6 |  7 | 8 | ## Running This Demo Locally on Your Machine 9 | 10 | ### 1. Install dependencies 11 | 12 | ```bash 13 | $ npm install 14 | ``` 15 | 16 | ### 2. Set up a config.js with Your Credentials 17 | 18 | Sign up at [Nexmo](https://nexmo.com) to get your own API keys and a virtual number. 19 | 20 | Create `config.js` in `/server`. The file should include the credentials. 21 | 22 | ```javascript 23 | module.exports = { 24 | api_key: 'f321a...', 25 | api_secret: '18e9aad...', 26 | number: '14155551234' 27 | }; 28 | ``` 29 | 30 | ### 3. Run the Node App 31 | 32 | ```bash 33 | $ node server/index.js 34 | ``` 35 | 36 | ### 4. Launch it on Browser 37 | 38 | Go to [http://localhost:4000](http://localhost:4000) and send text messages. 39 | -------------------------------------------------------------------------------- /views/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |
21 | Enter a number, begins with a country code
25 | 30 |