小黑学前端日记——第1天
2020/11/30
搜了搜前端入门,感觉可以从 vue 入手,然后好像要先装 nodejs,那就先学学 nodejs 好了
安装 node.js
下载node:https://nodejs.org/en/download/
然后装好了
运行 helloworld
var http = require('http');
http.createServer(function (request, response) {
// 发送 HTTP 头部
// HTTP 状态值: 200 : OK
// 内容类型: text/plain
response.writeHead(200, {'Content-Type': 'text/plain'});
// 发送响应数据 "Hello World"
response.end('Hello World\n');
}).listen(8888);
// 终端打印如下信息
console.log('Server running at http://127.0.0.1:8888/');
啪地一下就出来了,很快啊!
npm
感觉就是和 python 的 pip,ubuntu 的 apt,centos 的 yum 一样的东西
交互式命令
退出: 两次 ctrl+C
回调函数
好了,今天先学到这里,收工!