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

docs: Added example file, updated .gitignore and README. #41

Merged
merged 3 commits into from
Oct 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ node_modules
.node_repl_history

# Editor
.vscode*
.vscode*

# Environment files
.env/*.*
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,31 @@ client.API(request, function (response) {

<a name="usage"></a>
# Usage

Following is an example using SendGrid. You can get your free account [here](https://sendgrid.com/free?source=nodejs-http-client).

First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).

```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```

You can copy the .env_example file located in the "examples" folder to ```.env``` in your project's root.

```cp examples/.env_sample .env```

Then add your API Key into the file

Here is the [full working code](https://github.com/sendgrid/nodejs-http-client/blob/master/examples/example.js).

To run the example:

```bash
node examples/example
```
=======
[Library Usage Documentation](https://github.com/sendgrid/nodejs-http-client/blob/master/USAGE.md)

<a name="roadmap"></a>
Expand Down
1 change: 1 addition & 0 deletions examples/.env_sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export SENDGRID_API_KEY=''