Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
add example dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
julie-ng committed Sep 28, 2019
1 parent 4198415 commit 0b7ef14
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FOO=bar
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
dist/

*.DS_Store
*.tmp
*.tmp
*.env
5 changes: 5 additions & 0 deletions app/server.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict'
const app = require('./app')
const http = require('http')

if (process.env.NODE_ENV === 'development') {
require('dotenv').config()
}

const port = process.env.PORT || 3000

const server = http.createServer(app)
Expand Down

0 comments on commit 0b7ef14

Please sign in to comment.