Skip to content
This repository was archived by the owner on Aug 20, 2020. It is now read-only.

Commit 273ca46

Browse files
author
Matt Bernier
authored
Merge pull request #41 from dhsrocha/master
Added example file, updated .gitignore and README.
2 parents 56531b9 + 3da2ece commit 273ca46

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@ node_modules
3737
.node_repl_history
3838

3939
# Editor
40-
.vscode*
40+
.vscode*
41+
42+
# Environment files
43+
.env/*.*

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,31 @@ client.API(request, function (response) {
9595

9696
<a name="usage"></a>
9797
# Usage
98+
99+
Following is an example using SendGrid. You can get your free account [here](https://sendgrid.com/free?source=nodejs-http-client).
100+
101+
First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
102+
103+
```bash
104+
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
105+
echo "sendgrid.env" >> .gitignore
106+
source ./sendgrid.env
107+
```
108+
109+
You can copy the .env_example file located in the "examples" folder to ```.env``` in your project's root.
110+
111+
```cp examples/.env_sample .env```
112+
113+
Then add your API Key into the file
114+
115+
Here is the [full working code](https://github.com/sendgrid/nodejs-http-client/blob/master/examples/example.js).
116+
117+
To run the example:
118+
119+
```bash
120+
node examples/example
121+
```
122+
=======
98123
[Library Usage Documentation](https://github.com/sendgrid/nodejs-http-client/blob/master/USAGE.md)
99124

100125
<a name="roadmap"></a>

examples/.env_sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export SENDGRID_API_KEY=''

0 commit comments

Comments
 (0)