-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBK9.js
More file actions
41 lines (33 loc) · 1.13 KB
/
BK9.js
File metadata and controls
41 lines (33 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const express = require("express");
const app = express();
const api = require("./api");
//===========================================================================>
app.use(express.json());
app.set("json spaces", 2); //عشان يجيك الرد مفرق اسطر مب كل شي بسطر واحد
const port = process.env.PORT || 3000; //منفذ الخادم
app.use(api);
function getBaseUrl(req) {
return req.protocol + '://' + req.get('host');
}
// صفحة نمشي بها حاليا
app.get("/", (req, res) => {
const test = getBaseUrl(req);
res.send(`
<!DOCTYPE html>
<html>
<head>
<title>BK9</title>
</head>
<body>
<h1>احبكم</h1>
<p>اتمنى الكل فهم واستفاد</p>
<a href="${test}/gpt4?q=السلام%20عليكم">إضغط هنا</a> //localhost تعني المكان الي انت مشغل فيه الموقع
</body>
</html>
`);
});
app.listen(port, () => {
console.log(`server running on port ${port}`);
});
//===========================================================================>
module.exports = app;