{"_id":"7945-site","_rev":"4-cf6af04b1c48e8a1aad33b849d354257","name":"7945-site","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0":{"name":"7945-site","version":"1.0.0","keywords":["http"],"author":{"name":"sbusiedcake7945"},"license":"MIT","_id":"7945-site@1.0.0","maintainers":[{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"}],"dist":{"shasum":"28f62670aaef19c836d0e8c7d0c96187b2ec1564","tarball":"https://registry.npmjs.org/7945-site/-/7945-site-1.0.0.tgz","fileCount":3,"integrity":"sha512-bQxhoOZqI1PtKoah5sFTyaT7QcCYvUyvY2XDEpPL1hbv28QK6ktbN+RgudfjFHEVLeDg3S7fXqL6DQT8T+WCiQ==","signatures":[{"sig":"MEUCIE/7nlXyyD7AdzfQkSY5VyNe/Iw20amwns2vYmILAxTFAiEAxDADd2dOx+9gTGDQ5gmyPSMswEElCiWdCHRQiAEXrSw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8272},"main":"7945-site.js","type":"commonjs","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"},"_npmVersion":"11.6.2","description":"a basic website creating module","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/7945-site_1.0.0_1763845820167_0.09253415624059969","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"7945-site","version":"1.0.1","keywords":["http"],"author":{"name":"sbusiedcake7945"},"license":"MIT","_id":"7945-site@1.0.1","maintainers":[{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"}],"homepage":"https://github.com/sbusiedcake7945/7945-site#readme","bugs":{"url":"https://github.com/sbusiedcake7945/7945-site/issues"},"dist":{"shasum":"c149631cf00ac98b8363ab2b43093fa98e550b44","tarball":"https://registry.npmjs.org/7945-site/-/7945-site-1.0.1.tgz","fileCount":4,"integrity":"sha512-vryI5s9msjMnspA2HYWF8pAa6ESdnSEasDJgD60dVJjZXse4Ze6f87rY+uBpUk4PLghrNOlkJ3BmoTJ8NxZnMA==","signatures":[{"sig":"MEUCIQDPpH8qiWkP+ddrQ2HvTrzwmrWQtopwcAaeN6zMejTKZAIgd+7qBgNLpXwrDPaTko1thZXH0zaNcAPrh3NhL21hWCw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9416},"main":"7945-site.js","type":"commonjs","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"},"repository":{"url":"git+https://github.com/sbusiedcake7945/7945-site.git","type":"git"},"_npmVersion":"11.6.2","description":"a basic website creating module","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/7945-site_1.0.1_1763847296821_0.45431048402857366","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"7945-site","version":"1.0.2","keywords":["http"],"author":{"name":"sbusiedcake7945"},"license":"MIT","_id":"7945-site@1.0.2","maintainers":[{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"}],"homepage":"https://github.com/sbusiedcake7945/7945-site#readme","bugs":{"url":"https://github.com/sbusiedcake7945/7945-site/issues"},"dist":{"shasum":"eac053061ee191bbe0c44c2ff9f3d452c04d21d7","tarball":"https://registry.npmjs.org/7945-site/-/7945-site-1.0.2.tgz","fileCount":4,"integrity":"sha512-YzpwC35emzUCNsdmppDEoNcXZkovzWvdQO9DI01OxCzg3SuUcuRLVyPn2nwkiXTy6fV3/j08xs9pIccDWhjUrg==","signatures":[{"sig":"MEQCIBJX/EANzl/KpWiGQD4q0lDO8yka9MJoDU3pECx6X0jdAiBAxy81r+iqOuVTDhRnshmmR8po3Gy08u+uXktHTneGwg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":9417},"main":"7945-site.js","type":"commonjs","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"},"repository":{"url":"git+https://github.com/sbusiedcake7945/7945-site.git","type":"git"},"_npmVersion":"11.6.2","description":"a basic website creating module","directories":{},"_nodeVersion":"24.11.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/7945-site_1.0.2_1763847449184_0.23767837871029984","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"7945-site","version":"1.1.2","description":"a basic website creating module","keywords":["http"],"repository":{"type":"git","url":"git+https://github.com/sbusiedcake7945/7945-site.git"},"license":"MIT","author":{"name":"sbusiedcake7945"},"type":"commonjs","main":"7945-site.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_id":"7945-site@1.1.2","bugs":{"url":"https://github.com/sbusiedcake7945/7945-site/issues"},"homepage":"https://github.com/sbusiedcake7945/7945-site#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-CAD2AP6S/sxTRCxIwluAvG+ETvk0Nhcw5U/TCbJ8cmKC7jTCliRrj4+Wfg7hJb6lOZudlkVpDHdX9eXqt/8R+Q==","shasum":"c4377258c5d64d4e32849c028c521048b3b09c47","tarball":"https://registry.npmjs.org/7945-site/-/7945-site-1.1.2.tgz","fileCount":4,"unpackedSize":14800,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCKrxSey18K3mr+5eOqVBKo8Au0m4QnNF0XRBTyXzM1hQIhALzw59txgszNl73Y0cOM63nABKsVzr4ue87ffS/Wel0v"}]},"_npmUser":{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"},"directories":{},"maintainers":[{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/7945-site_1.1.2_1764018148938_0.18321880036471727"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-22T21:10:20.084Z","modified":"2025-11-24T21:02:29.348Z","1.0.0":"2025-11-22T21:10:20.376Z","1.0.1":"2025-11-22T21:34:57.012Z","1.0.2":"2025-11-22T21:37:29.375Z","1.1.2":"2025-11-24T21:02:29.149Z"},"bugs":{"url":"https://github.com/sbusiedcake7945/7945-site/issues"},"author":{"name":"sbusiedcake7945"},"license":"MIT","homepage":"https://github.com/sbusiedcake7945/7945-site#readme","keywords":["http"],"repository":{"type":"git","url":"git+https://github.com/sbusiedcake7945/7945-site.git"},"description":"a basic website creating module","maintainers":[{"name":"sbusiedcake7945","email":"mamananam665@gmail.com"}],"readme":"# 7945-site\r\n\r\n**7945-site** Node.js ile yazılmış minimal, tek dosyalık HTTP server framework’üdür.  \r\nExpress benzeri ama daha hafif, HTML error page ve **res.title / res.red** özellikleri ile birlikte gelir.\r\n\r\n---\r\n\r\n## 🔹 Özellikler\r\n\r\n- GET, POST, DELETE, PULL route desteği\r\n- Wildcard route: `*` → tüm sayfalar\r\n- Query parametre route: `?key` → res.red zorunlu\r\n- `res.title(\"<Başlık>\")` → HTML `<title>` otomatik ekleme\r\n- `res.red(\"<url>\", <saniye>)` → opsiyonel gecikmeli redirect\r\n- HTML error page, stack trace ile gösterim\r\n- kolay anlaşılır\r\n\r\n---\r\n\r\n## 🔹 Kurulum\r\n\r\n```bash\r\nnpm install 7945-site\r\n```\r\n\r\n---\r\n\r\n## 🔹 Kullanım\r\n\r\n```js\r\nconst site = require(\"7945site\");\r\nconst app = new site();\r\n\r\n// GET route\r\napp.get(\"/\", (req, res) => {\r\n  res.title(\"Ana Sayfa\");      // sayfa başlığı\r\n  res.end(\"Merhaba dünya\"); // içerik\r\n});\r\n\r\n// Query route, res.red zorunlu\r\napp.get(\"?deneme\", (req, res) => {\r\n  res.red(\"/404\", 2);          // 2 saniye sonra yönlendir\r\n});\r\n\r\napp.listen(3000, () => console.log(\"Server çalışıyor: http://localhost:3000\"));\r\n```\r\n\r\nveya\r\n```js\r\nconst site = require(\"7945-site\");\r\nconst app = new site();\r\nconst port = 3000; // port \"3000\" olmak zorunda değil bu sadece örnek\r\n\r\n// GET route\r\napp.get(\"/\", (req, res) => {\r\n  res.title(\"Ana Sayfa\");      // sayfa başlığı\r\n  res.end(\"Merhaba dunya\"); // içerik\r\n});\r\n\r\n// Query route, res.red zorunlu\r\napp.get(\"?deneme\", (req, res) => {\r\n  res.red(\"/404\", 2);          // 2 saniye sonra yönlendir\r\n});\r\n\r\napp.listen(port, () => console.log(`Server çalışıyor: http://localhost:${port}`));\r\n```\r\n\r\n---\r\n\r\n## 🔹 res.title\r\n\r\n`res.title(\"<Başlık>\")` fonksiyonu:\r\n\r\n* HTML `<title>` elementini otomatik olarak ekler\r\n* `res.end()` çağrılmadan önce kullanılması yeterlidir\r\n* Örnek:\r\n\r\n```js\r\napp.get(\"/\", (req, res) => {\r\n  res.title(\"Ana Sayfa\");\r\n  res.end(\"İçerik burada\");\r\n});\r\n```\r\n\r\n---\r\n\r\n## 🔹 res.red\r\n\r\n`res.red(\"<url>\", <time>)` fonksiyonu:\r\n\r\n* `<url>` → yönlendirilecek adres\r\n* `<time>` (opsiyonel) → saniye cinsinden gecikme\r\n* Örnekler:\r\n\r\n```js\r\nres.red(\"/404\");       // hemen yönlendir\r\nres.red(\"/\", 3);       // 3 saniye sonra yönlendir\r\n```\r\n\r\n---\r\n\r\n## 🔹 res.file\r\n\r\n`res.file(path.join(__dirname, 'hedef dosya/klasör'))` fonksonu:\r\n\r\n* path kullanarak dosya bağlanılabilir\r\n* örnekler:\r\n\r\n```js\r\nres.file(path.join(__dirname, 'public/'));\r\nres.file(path.join(__dirname, 'public/', 'index.html'));\r\n```\r\n\r\n---\r\n## 🔹 app.use\r\n\r\n`app.use(\"<./dosya>/<dosya>\")` fonksyonu:\r\n\r\n* harici modül bağlanabilir(cors, body-parser)\r\n* bir klasörü kullanmak için yapıldı(public klasörü)\r\n* örnekler\r\n\r\n```js\r\napp.use(\"cors\");\r\napp.use(\"body-parser\");\r\napp.use(\"public\");\r\napp.use(\"./deneme\")\r\n```\r\n\r\n---\r\n\r\n## 🔹 Error Page\r\n\r\n* Kodda hata oluşursa otomatik error page açılır\r\n* Hatalı satır ve stack trace gösterilir\r\n* Yeşil temalı, kodlama dostu tasarım\r\n\r\n---\r\n\r\n## 🔹 404 hata\r\n\r\n* eğer girilen url yanlışsa 404 sayfasını açar\r\n* 404 sayfası ulaşılmaya çalışılan sayfayı gösterir ve yönlendirme yapmaz\r\n* 404 sayfasından hangi sayfanın olmadığını veya yüklenmediği görülebilir\r\n\r\n---\r\n\r\n## 🔹 Notlar\r\n\r\n* Node.js ≥ 14 önerilir\r\n* `url.parse()` yerine modern `URL` kullanılabilir\r\n* `res.end()` çağrısından sonra `res.title()` veya `res.red()` çağrılmaz çünkü `res.end()` son söz sahibidir","readmeFilename":"README.md"}