From 9179ec94b32974e48830bc8ef5c3643f3feafdb6 Mon Sep 17 00:00:00 2001 From: M1n-0 <145598371+M1n-0@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:26:12 +0200 Subject: [PATCH] try backend js --- js/app.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index e2664f3..ce28be9 100644 --- a/js/app.js +++ b/js/app.js @@ -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, () => {