memem / app.js
pluviouse's picture
Create app.js
4d1f385 verified
raw
history blame
418 Bytes
const express = require('express');
const app = express();
// Inisialisasi penghitung hit
let hitCount = 0;
// Route untuk menghitung hit
app.get('/', (req, res) => {
hitCount++;
res.json({
message: 'Selamat datang di penghitung hit!',
hits: hitCount
});
});
// Mendengarkan di port 7680
const PORT = 7680;
app.listen(PORT, () => {
console.log(`Server berjalan di port ${PORT}`);
});