working node server
This commit is contained in:
12
http.js
Normal file
12
http.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const http = require("http");
|
||||
|
||||
http.createServer((req, res) => {
|
||||
const host = req.headers.host || "";
|
||||
console.log("working")
|
||||
res.writeHead(301, {
|
||||
"Location": `https://${host}${req.url}`
|
||||
});
|
||||
res.end();
|
||||
}).listen(2000, () => {
|
||||
console.log("🔁 Redirect server running on port 2000");
|
||||
});
|
||||
Reference in New Issue
Block a user