Skip to content

Commit

Permalink
Move location where 'dotenv' is being required (#21)
Browse files Browse the repository at this point in the history
In a previous commit #10 the 'dotenv' package was moved as early as possible in the application.

Unfortunately this has turned out to be a bit too early and is causing some issues when running the unit tests locally. The unit tests don't use the /index.js so 'dotenv' is never required.

The 'dotenv' require therefore needs to be moved up a level to /app/server.js.
  • Loading branch information
Jozzey authored Nov 8, 2022
1 parent 2d904c0 commit 5c23f0a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'

require('dotenv').config()

const Hapi = require('@hapi/hapi')

const ServerConfig = require('../config/server.config.js')
Expand Down
2 changes: 0 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict'

require('dotenv').config()

const { start } = require('./app/server')

start()

0 comments on commit 5c23f0a

Please sign in to comment.