diff --git a/.github/workflows/int_poweron-nyla-int.yml b/.github/workflows/int_poweron-nyla-int.yml index 5e0706c..e4bb2bf 100644 --- a/.github/workflows/int_poweron-nyla-int.yml +++ b/.github/workflows/int_poweron-nyla-int.yml @@ -31,28 +31,26 @@ jobs: - name: Create server.js for Azure run: | # Create ES module compatible server.js directly in root - cat > server.js << 'EOF' - 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(); - - app.use(express.static(path.join(__dirname, 'dist'))); - - app.get('/*', function(req, res) { - res.sendFile(path.join(__dirname, 'dist', 'index.html')); - }); - - const port = process.env.PORT || 8080; - app.listen(port, '0.0.0.0', () => { - console.log(`Server running on port ${port}`); - console.log(`Serving from: ${__dirname}/dist`); - }); - EOF + echo "import express from 'express';" > server.js + echo "import path from 'path';" >> server.js + echo "import { fileURLToPath } from 'url';" >> server.js + echo "" >> server.js + echo "const __filename = fileURLToPath(import.meta.url);" >> server.js + echo "const __dirname = path.dirname(__filename);" >> server.js + echo "" >> server.js + echo "const app = express();" >> server.js + echo "" >> server.js + echo "app.use(express.static(path.join(__dirname, 'dist')));" >> server.js + echo "" >> server.js + echo "app.get('/*', function(req, res) {" >> server.js + echo " res.sendFile(path.join(__dirname, 'dist', 'index.html'));" >> server.js + echo "});" >> server.js + echo "" >> server.js + echo "const port = process.env.PORT || 8080;" >> server.js + echo "app.listen(port, '0.0.0.0', () => {" >> server.js + echo " console.log(\`Server running on port \${port}\`);" >> server.js + echo " console.log(\`Serving from: \${__dirname}/dist\`);" >> server.js + echo "});" >> server.js # Verify the file was created echo "=== server.js content ==="