Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load variables from .env before requiring routes #583

Merged
merged 2 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ New Features:

Bug fixes:

- [Fix loading variables from .env](https://github.com/alphagov/govuk-prototype-kit/pull/583)
- [Update link from question page template to design system](https://github.com/alphagov/govuk-prototype-kit/pull/575)
- [Changed block name to bodyEnd to fix scripts in unbranded template](https://github.com/alphagov/govuk-prototype-kit/pull/580)

Expand Down
5 changes: 3 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const nunjucks = require('nunjucks')
const session = require('express-session')
const cookieParser = require('cookie-parser')

// Run before other code to make sure variables from .env are available
dotenv.config()

// Local dependencies
const config = require('./app/config.js')
const documentationRoutes = require('./docs/documentation_routes.js')
Expand Down Expand Up @@ -39,8 +42,6 @@ if (useV6) {
v6App = express()
}

dotenv.config()

// Set cookies for use in cookie banner.
app.use(cookieParser())
documentationApp.use(cookieParser())
Expand Down