随笔分类 - node
js in server
摘要:1. 文件夹 增加文件夹 var fs = require("fs"); console.log("创建目录 tmp"); fs.mkdir("tmp",function(err){ if (err) { return console.error(err); } console.log("目录创建成
阅读全文
摘要:1.结构 node_modules ( ... ) routers ( main.js ) views ( index.html about.HTML 404.html ) app.js package.json 2. 文件 package.json { "name": "wj", "version
阅读全文
摘要:1.小程序理解 基于微信的 免安装 MVVM 应用 编码使用 ES 6 一个页面基本组成:wxml wxss js ( html、css、js ) 2. 常见用法 ( 基本就是跟着例子走。。 ) 设置值 this.setData({ userInfo: e.detail.userInfo, hasU
阅读全文
摘要:node 作为服务端 - 基本使用 1. web 服务器 web.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>菜鸟教程(runoob.com)</title> <style> div{ border: 1px so
阅读全文
摘要:1. 执行 node helloworld.js 2. http 服务器 建 server.js 文件 - node server.js 跑起来 - 浏览器访问 http://localhost:8888/ (服务器控制台观看访问次数) var http = require("http"); var
阅读全文
摘要:node -v node 版本 npm -v npm版本号,npm是在安装nodejs时一同安装的nodejs包管理器 (注册、安装模块,和小乌龟有点像) npm list 当前目录已安装插件 npm list -g 查看所有全局安装的模块: npm init 生成 package.json 查看n
阅读全文