Skip to content

Create home.html #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create home.html #96

wants to merge 1 commit into from

Conversation

njood8
Copy link

@njood8 njood8 commented Jul 6, 2025

const express = require('express');
const path = require('path');
const app = express();

// السماح للملفات الثابتة
app.use(express.static(__dirname));

// للسماح بقراءة JSON من body
app.use(express.json());

// عرض الصفحة الرئيسية
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'home.html'));
});

// ✅ هنا الباكند اللي يتلقى البيانات
app.post('/api/hello', (req, res) => {
const name = req.body.name;
res.json({ message: 👋 Hello, ${name}! });
});

const port = 3000;
app.listen(port, () => {
console.log(✅ Server is running at http://localhost:${port});
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant