From 6c594bd649319dd5e7a9f60a8732126692077ba8 Mon Sep 17 00:00:00 2001 From: numex-admin Date: Thu, 10 Sep 2026 08:07:22 +0000 Subject: [PATCH] =?UTF-8?q?Numex=20yay=C4=B1n:=20server.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 server.js diff --git a/server.js b/server.js new file mode 100644 index 0000000..f1396cc --- /dev/null +++ b/server.js @@ -0,0 +1,23 @@ +const express = require('express'); +const path = require('path'); +const apiRoutes = require('./routes/api'); + +const app = express(); +const PORT = process.env.PORT || 3000; + +// Middleware +app.use(express.json()); +app.use(express.static(path.join(__dirname, 'public'))); + +// API rotaları +app.use('/api', apiRoutes); + +// Ana sayfa +app.get('/', (req, res) => { + res.sendFile(path.join(__dirname, 'public', 'index.html')); +}); + +// Sunucuyu başlat +app.listen(PORT, () => { + console.log(`Sunucu http://localhost:${PORT} adresinde çalışıyor`); +});