Skip to content

Commit

Permalink
add env validator
Browse files Browse the repository at this point in the history
  • Loading branch information
Jardel Matias committed Aug 13, 2022
1 parent 3baa890 commit d8bc979
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions demo05-envs/envs-project/serverless/envs-validation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const envVar = require('env-var')

const settings = {
NODE_ENV: envVar.get('NODE_ENV').required().asEnum(['LOCAL', 'DEVELOPMENT', 'HOMOLOG', 'PRODUCTION']),
BASE_URL: envVar.get('BASE_URL').required().asUrlString(),
TABLE_NAME: envVar.get('TABLE_NAME').required().asString(),
WRITE_CAPACITY: envVar.get('WRITE_CAPACITY').required().asInt(),
READ_CAPATICY: envVar.get('READ_CAPATICY').required().asInt()
}

module.exports = settings

0 comments on commit d8bc979

Please sign in to comment.