Last active
April 26, 2017 16:41
-
-
Save du5rte/2e580ea588a9f7843cdde9376efc6ff6 to your computer and use it in GitHub Desktop.
dotenv improvements
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
// better file checker | |
// https://nodejs.org/dist/latest-v7.x/docs/api/fs.html#fs_fs_readfilesync_file_options | |
fs.accessSync(path.resolve(__dirname,'./config-local.json'), fs.R_OK); | |
// add .env.js | |
```js | |
const envJS = require('./.env.js') | |
await envJS() | |
``` | |
```js | |
export default async function() { | |
return await fetch('http://someoauth.com/auth') | |
} | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment