我們可以使用以下命令來查看當前的 Node 版本:
node -v

接下來創建我的第一個node.js應用
server.js
var http=require("http");//引入http模塊 //創建服務器 http.createServer(function(request,response){ //發送http頭,狀態200:ok,型別:text/plain response.writeHead(200,{"Content-Type":"text/plain"}); //發送回應資料 response.end("hello cyy"); }).listen(8888);//監聽8888埠 console.log("look at localhost:8888");
使用 node 命令執行以上的代碼:

瀏覽器上的頁面

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/144312.html
標籤:JavaScript
上一篇:invalid prop `current` of type `string` supplied to `pagination`, expected `
