Skip to content

Commit

Permalink
feat: preview mode env control
Browse files Browse the repository at this point in the history
  • Loading branch information
Oğuzhan Aslan committed May 22, 2024
1 parent 3211ddf commit 89b262a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "voltranjs",
"version": "1.1.6",
"version": "1.1.7",
"main": "src/index.js",
"author": "Hepsiburada Technology Team",
"bin": {
Expand Down
3 changes: 2 additions & 1 deletion src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ export default async (req, res) => {
.observe(Date.now() - res.locals.startEpoch);
} else {
const voltranEnv = appConfig.voltranEnv || 'local';
const previewEnvControl = voltranEnv !== 'prod' || voltranEnv !== 'production';

if (voltranEnv !== 'prod' && isPreviewQuery) {
if (previewEnvControl && isPreviewQuery) {
res.status(statusCode).html(Preview([fullHtml].join('\n')));
} else {
res
Expand Down

0 comments on commit 89b262a

Please sign in to comment.