-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from VishalMCF/Add-User-Agent-Header
Add user agent header
- Loading branch information
Showing
3 changed files
with
28 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,34 @@ | ||
package co.novu.common.base; | ||
|
||
import org.apache.maven.model.Model; | ||
import org.apache.maven.model.io.xpp3.MavenXpp3Reader; | ||
|
||
import java.io.FileReader; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class NovuConfig { | ||
|
||
private String apiKey; | ||
private String baseUrl = "https://api.novu.co/v1/"; | ||
private String sdkName; | ||
private String sdkVersion; | ||
public NovuConfig(String apiKey) { | ||
this.apiKey = apiKey; | ||
loadContextFromPom(); | ||
} | ||
|
||
private String apiKey; | ||
private String baseUrl = "https://api.novu.co/v1/"; | ||
private void loadContextFromPom(){ | ||
try { | ||
MavenXpp3Reader reader = new MavenXpp3Reader(); | ||
Model model = reader.read(new FileReader("pom.xml")); | ||
this.sdkName = model.getArtifactId(); | ||
this.sdkVersion = model.getVersion(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters