Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
fix(view): use NODE_ENV for local dev, not package.json version
Browse files Browse the repository at this point in the history
  • Loading branch information
julie-ng committed Jun 28, 2022
1 parent ec5c5aa commit 96d2d1d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ const ASSETS_BASE_URL = process.env.ASSETS_BASE_URL
|| AZURE_APP_SERVICE_HOSTNAME
|| `http://localhost:${PORT}`

const APP_VERSION = process.env.NODE_ENV === 'production'
? 'v' + process.env.npm_package_version
: process.env.NODE_ENV

let app = express()

// --- Static Assets ---
Expand Down Expand Up @@ -49,7 +53,7 @@ app.set('view options', { layout: 'layout' })
app.get('/', (req, res) => {
res.render('home', {
title: 'Node.js on Azure Demo',
version: 'v' + process.env.npm_package_version,
version: APP_VERSION,
cssFileUrl: cssFileUrl,
assetsBaseUrl: ASSETS_BASE_URL
})
Expand Down

0 comments on commit 96d2d1d

Please sign in to comment.