javascript: node.js

 

const http=require("http");
http.createServer(function (request,response){
    response.writeHead(200,{'Content-type':'text/html'});
    response.end('<h1> hello geovindu 2023 </h1>');
}).listen(3000);
console.log('Server running at http://127.0.0.1:3000/');
//C:\Users\geovindu\WebstormProjects\untitled>node "helloworld.js" Server runing at http://127.0.0.1:3000/

  

const express=require('express');
const app=express();
app.get('/',(req,res)=>res.send('hello geovindu 塗聚文, 2023'));
app.listen(3000,()=>console.log('Example app listening on port 3000!'))
// Express
//C:\Users\geovindu\WebstormProjects\untitled>node app.js

  

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章