18 lines
453 B
JavaScript
18 lines
453 B
JavaScript
const http = require("http");
|
|
|
|
const PORT = 8080;
|
|
|
|
const server = http.createServer((req, res) => {
|
|
if (req.method === "GET" && req.url === "/") {
|
|
res.writeHead(200, { "Content-Type": "text/plain" });
|
|
res.end("7thhh updateesdsdfsfdsest new testing update");
|
|
} else {
|
|
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
res.end("Not Found");
|
|
}
|
|
});
|
|
|
|
server.listen(PORT, () => {
|
|
console.log(`Server running on port ${PORT}`);
|
|
});
|