%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/n8ao/
Upload File :
Create Path :
Current File : //home2/rezakur1/ai.rezakurnia.com/zh-router-frontend/node_modules/n8ao/dev-server.js

import express from 'express';
import cors from 'cors';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

const app = express();

// Enable CORS for all routes
app.use(cors());

// Since __dirname is not defined in ES modules, you have to derive it
const __filename = fileURLToPath(
    import.meta.url);
const __dirname = dirname(__filename);

// Serve static files from the 'public' directory (update the path as necessary)
app.use(express.static(__dirname));

app.get('/', (_req, res) => {
  res.status(200).send(`
<!DOCTYPE html>
<body>
    <h1>N8AO</h1>
    <ul>
        <li><a href="/example">Example</a></li>
        <li><a href="/example_postprocessing">Example Postprocessing</a></li>
    </ul>
</body>
`);
});

const port = process.env.PORT || 8080;

app.listen(port, () => {
    console.log(`Server running on port ${port}`);
});

Zerion Mini Shell 1.0