-
-
Notifications
You must be signed in to change notification settings - Fork 182
/
Copy pathapp.js
25 lines (20 loc) · 911 Bytes
/
app.js
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
const express = require('express');
const app = express();
const hostname = '127.0.0.1'; // Your server ip address
const port = 3000;
const version = '1.0.0';
app.get('/', (req, res) => {
// set response content
res.send(`<html>
<body>
<h1 style="color:blue;text-align: center;margin-top: 100px;"> [Version ${version}]: This is AMAZING!!! Like & Subscribe!</h1>
<div style="position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%)">
<img src="https://picsum.photos/400/400?random=1">
</div>
</body>
</html>`);
console.log(`[Version ${version}]: New request => http://${hostname}:${port}`+req.url);
})
app.listen(port, () => {
console.log(`[Version ${version}]: Server running at http://${hostname}:${port}/`);
})