1
+ <a href =" https://www.twilio.com " >
2
+ <img src =" https://static0.twilio.com/marketing/bundles/marketing/img/logos/wordmark-red.svg " alt =" Twilio " width =" 250 " />
3
+ </a >
4
+
1
5
# Server notifications with Twilio, Node.js, and Express
2
6
3
7
[ ![ Build Status] ( https://travis-ci.org/TwilioDevEd/call-tracking-node.svg?branch=master )] ( https://travis-ci.org/TwilioDevEd/server-notifications-node )
@@ -6,66 +10,70 @@ Use Twilio to send SMS alerts so that you never miss a critical issue.
6
10
7
11
[ Read the full tutorial here] ( https://www.twilio.com/docs/tutorials/walkthrough/server-notifications/node/express ) !
8
12
9
- ## Running the Project on Your Machine
13
+ ## Local development
10
14
11
- To run this project on your computer, download or clone the source. You will
12
- also need to download and install either [ Node.js] ( http://nodejs.org/ )
13
- or [ io.js] ( https://iojs.org/en/index.html ) , both of which should also install
14
- [ npm] ( https://www.npmjs.com/ ) .
15
+ To run this project on your computer you will
16
+ need to download and install either [ Node.js] ( http://nodejs.org/ )
17
+ or [ io.js] ( https://iojs.org/en/index.html ) , both of which should also install
18
+ [ npm] ( https://www.npmjs.com/ ) .
15
19
16
- You will also need to [ sign up for a Twilio account] ( https://www.twilio.com/try-twilio )
20
+ You will also need to [ sign up for a Twilio account] ( https://www.twilio.com/try-twilio )
17
21
if you don't have one already.
18
22
19
- ### Install Dependencies
23
+ 1 . First clone this repository and ` cd ` into it.
20
24
21
- Navigate to the project directory in your terminal and run:
25
+ ``` bash
26
+ $ git clone
[email protected] :TwilioDevEd/server-notifications-node.git
27
+ $ cd server-notifications-node
28
+ ```
22
29
23
- ``` bash
24
- npm install
25
- ```
30
+ 1 . Next, open ` .env.example ` at the root of the project and update it with
31
+ values from your
32
+ [ Twilio account] ( https://www.twilio.com/user/account/voice-messaging )
33
+ and local configuration. Save the file as ` .env ` . You'll need to set
34
+ ` TWILIO_AUTH_TOKEN ` , ` TWILIO_ACCOUNT_SID ` , and ` TWILIO_NUMBER ` .
26
35
27
- This should install all of our project dependencies from npm into a local
28
- ` node_modules ` folder.
36
+ For the ` TWILIO_NUMBER ` variable you'll need to provision a new number
37
+ in the
38
+ [ Manage Numbers page] ( https://www.twilio.com/user/account/phone-numbers/incoming )
39
+ under your account. The phone number should be in
40
+ [ E.164 format] ( https://www.twilio.com/help/faq/phone-numbers/how-do-i-format-phone-numbers-to-work-internationally )
29
41
30
- ### Configuration
42
+ Run ` source .env ` to export the environment variables.
31
43
32
- Next, open ` .env.example ` at the root of the project and update it with
33
- values from your
34
- [ Twilio account] ( https://www.twilio.com/user/account/voice-messaging )
35
- and local configuration. Save the file as ` .env ` . You'll need to set
36
- ` TWILIO_AUTH_TOKEN ` , ` TWILIO_ACCOUNT_SID ` , and ` TWILIO_NUMBER ` .
44
+ 1 . Navigate to the project directory in your terminal and run:
37
45
38
- For the ` TWILIO_NUMBER ` variable you'll need to provision a new number
39
- in the
40
- [ Manage Numbers page] ( https://www.twilio.com/user/account/phone-numbers/incoming )
41
- under your account. The phone number should be in
42
- [ E.164 format] ( https://www.twilio.com/help/faq/phone-numbers/how-do-i-format-phone-numbers-to-work-internationally )
46
+ ``` bash
47
+ npm install
48
+ ```
43
49
44
- ### Running the Project
50
+ This should install all of our project dependencies from npm into a local
51
+ ` node_modules` folder.
45
52
46
- To launch the application, you can use ` node . ` in the project's root directory.
47
- You might also consider using [ nodemon] ( https://github.com/remy/nodemon ) for
48
- this. It works just like the node command, but automatically restarts your
49
- application when you change any source code files.
53
+ 1. Make sure the tests succeed.
50
54
51
- Make sure you have customized the ` config/administrators.json ` file
52
- with your phone number and then open
53
- [ http://localhost:3000/error ] ( http://localhost:3000/error ) . You'll get a text message shortly
54
- informing you of an exception.
55
+ ` ` ` bash
56
+ $ npm test
57
+ ` ` `
55
58
56
- ``` bash
57
- npm install -g nodemon
58
- nodemon .
59
- ```
59
+ 1. To launch the application, you can use ` node . ` in the project ' s root directory.
60
+ You might also consider using [ nodemon](https://github.com/remy/nodemon) for
61
+ this. It works just like the node command, but automatically restarts your
62
+ application when you change any source code files.
60
63
61
- ### Running Tests
64
+ Make sure you have customized the `config/administrators.json` file
65
+ with your phone number and then open
66
+ [http://localhost:3000/error](http://localhost:3000/error). You' ll get a text message shortly
67
+ informing you of an exception.
62
68
63
- Basic functional tests can be run with:
69
+ ` ` ` bash
70
+ npm install -g nodemon
71
+ nodemon .
72
+ ` ` `
64
73
65
- ``` bash
66
- npm test
67
- ```
68
74
69
- ## License
75
+ # # Meta
70
76
71
- MIT
77
+ * No warranty expressed or implied. Software is as is. Diggity.
78
+ * [MIT License](http://www.opensource.org/licenses/mit-license.html)
79
+ * Lovingly crafted by Twilio Developer Education.
0 commit comments