From c6998cc888646b1c08e8c20c6d7bd2e94100f207 Mon Sep 17 00:00:00 2001 From: idittrich-valueon Date: Wed, 4 Jun 2025 12:33:42 +0200 Subject: [PATCH] Fix ES module compatibility - convert server.js to ES module syntax --- .github/workflows/int_poweron-nyla-int.yml | 1 + deploy-server.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/int_poweron-nyla-int.yml b/.github/workflows/int_poweron-nyla-int.yml index 7734429..f0a478b 100644 --- a/.github/workflows/int_poweron-nyla-int.yml +++ b/.github/workflows/int_poweron-nyla-int.yml @@ -66,3 +66,4 @@ jobs: app-name: 'poweron-nyla' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_D6C9359A57C5448A8C0BFA2D4C4B2068 }} package: ./deploy + clean: true diff --git a/deploy-server.js b/deploy-server.js index 8214b2c..dd43008 100644 --- a/deploy-server.js +++ b/deploy-server.js @@ -1,5 +1,10 @@ -const express = require('express'); -const path = require('path'); +import express from 'express'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + const app = express(); // Serve static files from current directory