From 3f5c875cf12ff741be963b267a0a1c1b966c3385 Mon Sep 17 00:00:00 2001 From: saqut Date: Sun, 28 Jan 2024 03:31:08 +0300 Subject: [PATCH] Trying deploy --- public/index.html | 11 +++++++++++ server.js | 12 +----------- server/http.js | 7 +++++++ server/public.js | 14 ++++++++++++++ 4 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 public/index.html create mode 100644 server/http.js create mode 100644 server/public.js diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..e8a6749 --- /dev/null +++ b/public/index.html @@ -0,0 +1,11 @@ + + + + + + Document + + +

Hello !

+ + \ No newline at end of file diff --git a/server.js b/server.js index 53ff525..ee8af7e 100644 --- a/server.js +++ b/server.js @@ -1,11 +1 @@ -const express = require("express"); - - -const app = express(); - -app.get("/",function(request, response){ - response.end("Merhaba") -}) - - -app.listen(6480,'0.0.0.0'); \ No newline at end of file +require("./server/http.js"); \ No newline at end of file diff --git a/server/http.js b/server/http.js new file mode 100644 index 0000000..124409b --- /dev/null +++ b/server/http.js @@ -0,0 +1,7 @@ +const express = require("express"); + +const app = express(); + +app.listen(6480,'0.0.0.0'); + +exports.app = app; \ No newline at end of file diff --git a/server/public.js b/server/public.js new file mode 100644 index 0000000..514a00b --- /dev/null +++ b/server/public.js @@ -0,0 +1,14 @@ +const express = require("express"); +const {resolve} = require("node:path"); +const {app} = require("./http"); + + +app.use( + express.static( + resolve(__dirname,"../public"), + { + acceptRanges: true, + etag: true + } + ) +); \ No newline at end of file