Files
hub/app.js
2024-06-05 20:03:57 +02:00

24 lines
676 B
JavaScript

const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
// Serve static files from the "assets" directory
app.use('/assets', express.static(path.join(__dirname, 'assets')));
// Serve HTML files from the "html" directory
app.use('/html', express.static(path.join(__dirname, 'html')));
// Serve the index.html file at the root URL
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
});
app.get('/test', (req, res)=> {
res.sendFile(path.join(__dirname, '/html/test.html'))
})
app.listen(port, '0.0.0.0', () => {
console.log(`Example app listening at http://localhost:${port}`);
});