try backend js

This commit is contained in:
M1n-0
2024-06-05 19:26:12 +02:00
parent a7259bc042
commit 9179ec94b3

View File

@@ -1,9 +1,11 @@
const express = require('express');
const path = require('path');
const app = express();
const port = 3000;
// Serve the index.html file at the root URL
app.get('/', (req, res) => {
res.send('Hello from Node.js and Express!');
res.sendFile(path.join(__dirname, '../html/index.html'));
});
app.listen(port, () => {