You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
390 B
14 lines
390 B
const http = require("http");
|
|
|
|
const server = http.createServer((req,res) =>{
|
|
res.statusCode = 200;
|
|
res.setHeader("Content-type", "text/html");
|
|
res.write("Gratulace k nodeJS serveru <br>");
|
|
res.end("Hello world\n");
|
|
});
|
|
|
|
const PORT = 3000;
|
|
server.listen(PORT, () => {
|
|
console.log(`Server running at http://localhost:${PORT}/ \n Ctrl+C pro vypnuti`})
|
|
});
|
|
//node index.js
|