Skip to content

Commit 4c8607d

Browse files
author
Matt Bernier
authored
Merge pull request #54 from dhsrocha/master
Added example file, updated .gitignore and README.
2 parents 39ee7b5 + ffdd17e commit 4c8607d

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ repo/
2222
/.settings/
2323
/.classpath
2424
/.project
25+
26+
# Environment files
27+
.env/*.*

README.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,34 @@ try {
117117

118118
<a name="usage"></a>
119119
# Usage
120-
[Library Usage Documentation](USAGE.md)
120+
121+
- [Example Code](https://github.com/sendgrid/java-http-client/tree/master/examples)
122+
- [Library Usage Documentation](USAGE.md)
123+
124+
125+
The example uses SendGrid, you can get your free account [here](https://sendgrid.com/free?source=java-http-client).
126+
127+
First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).
128+
129+
```bash
130+
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
131+
echo "sendgrid.env" >> .gitignore
132+
source ./sendgrid.env
133+
```
134+
135+
```bash
136+
mvn package
137+
cd examples
138+
javac -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example.java && java -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example
139+
```
140+
141+
## Environment Variables
142+
143+
You can do the following to create a .env file:
144+
145+
```cp .env_example .env```
146+
147+
Then, just add your API Key into your .env file.
121148

122149
<a name="roadmap"></a>
123150
# Roadmap
@@ -144,4 +171,4 @@ java-http-client is guided and supported by the SendGrid [Developer Experience T
144171
java-http-client is maintained and funded by SendGrid, Inc. The names and logos for java-http-client are trademarks of SendGrid, Inc.
145172

146173
# License
147-
[The MIT License (MIT)](LICENSE.md)
174+
[The MIT License (MIT)](LICENSE.txt)

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)