forked from brettneese/convict-provider-awsSsm
-
Notifications
You must be signed in to change notification settings - Fork 0
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 #98 from brettneese/master
refactor, simplify
- Loading branch information
Showing
5 changed files
with
279 additions
and
205 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
"use strict"; | ||
|
||
const convict = require("@hbkapps/convict"); | ||
convict.configureProvider(require("../index")); | ||
const convict = require("convict"); | ||
const getParams = require("../index"); | ||
|
||
module.exports = convict({ | ||
const config = { | ||
ip: { | ||
default: "127.0.0.1", | ||
format: "ipaddress", | ||
providerPath: "/test/foo/ip" // can use multiple basePaths, and we'll only need to contact AWS once per path | ||
}, | ||
port: { | ||
default: 0, | ||
format: "port", | ||
providerPath: "/test/PORT" | ||
} | ||
}).validate().getProperties(); | ||
}, | ||
}; | ||
|
||
const ssmParams = getParams("/example-app/"); | ||
|
||
module.exports = convict(config).load(ssmParams).validate().getProperties(); |
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,7 +1,5 @@ | ||
"use strict"; | ||
|
||
const path = require("path"); | ||
const http = require("http"); | ||
const config = require("./config"); | ||
|
||
console.log(config); | ||
console.log(config); |
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
Oops, something went wrong.