memem / app.js
pluviouse's picture
Update app.js
d5ba34b 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 7860
const PORT = 7860;
app.listen(PORT, () => {
console.log(`Server berjalan di port ${PORT}`);
});