Add pelajaran 1 (Nginx) and pelajaran 2 (Node) lab starters.

This commit is contained in:
sayudhalw
2026-07-16 12:53:06 +07:00
commit 5e1c4f797d
6 changed files with 123 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
const http = require("http");
const server = http.createServer((request, response) => {
// request = apa yang browser minta
// response = apa yang kita kirim balik
const waktu = new Date().toLocaleString("id-ID");
response.writeHead(200, {
"Content-Type": "text/html; charset=utf-8",
});
response.end(`<!DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8" />
<title>Hello Node</title>
</head>
<body>
<h1>Hello dari Node di homelab</h1>
<p>Ini bukan file HTML diam. Teks di bawah dibuat oleh JavaScript saat request datang.</p>
<p>Waktu server sekarang: <strong>${waktu}</strong></p>
<p>Path yang diminta: <code>${request.url}</code></p>
</body>
</html>`);
});
server.listen(3000, () => {
console.log("Server siap di port 3000");
});