上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: 1、npm init 2、安装ejs npm i ejs --save 3、app.js //第一个callback判断是否存在 第二个存在就返回 4、model中json文件 5、view中ejs.js文件 1 <!doctype html> 2 <html> 3 <head> 4 <meta c 阅读全文
posted @ 2019-07-07 14:03 疏影横斜水清浅 阅读(2112) 评论(1) 推荐(0) 编辑
摘要: (一)Node能够解决什么问题? 1)Node的首要目标是提供一种简单的,用于创建高性能服务器的开发工具 2)对比Java和Php的实现方式,Web服务器的瓶颈在于并发的用户量 3)Node在处理高并发,I/O密集场景有明显的性能优势 1)高并发,是指在同一时间并发访问服务器 2)I/O密集指的是文 阅读全文
posted @ 2019-07-01 00:39 疏影横斜水清浅 阅读(609) 评论(0) 推荐(0) 编辑
摘要: 1 const http = require('http'); 2 const fs = require('fs'); 3 const path = require('path'); 4 const url = require('url'); 5 6 // 1. 创建服务器 7 http.createServer((req, res) => { 8 // 1.1 获取u... 阅读全文
posted @ 2019-07-01 00:10 疏影横斜水清浅 阅读(731) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 5 6 7 8 9 用户名: 10 密 码: 11 12 13 14 1 const http = require('http'); 2 const queryString = require('querystring'); 3 const util = require('util'... 阅读全文
posted @ 2019-06-30 23:57 疏影横斜水清浅 阅读(926) 评论(0) 推荐(0) 编辑
摘要: 1 const http = require('http'); 2 3 let server = http.createServer((req, res)=>{ 4 res.end('hello, world!'); 5 }); 6 7 server.listen(3000, '127.0.0.1', ()=>{ 8 console.log('服务器已经启动!... 阅读全文
posted @ 2019-06-30 23:54 疏影横斜水清浅 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 1 // 引入http模块 2 let http = require('http'); 3 4 /* 5 // 创建一个web服务器 6 let server = http.createServer((req, res)=>{ 7 res.end('Hello, itLike~~~~~~~~~~~ha ha ha'); 8 }); 9 10 // 监听 11 ser... 阅读全文
posted @ 2019-06-30 17:15 疏影横斜水清浅 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1 let fs = require('fs'); 2 3 2. 同步读取 4 let fd = fs.readFileSync(__dirname + '/source/a.txt'); 5 console.log(fd); 6 console.log(fd.toString()); 7 8 console.log('后续的操作'); 9 10 3. 异步读取 11 f... 阅读全文
posted @ 2019-06-30 17:14 疏影横斜水清浅 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 1 @charset "UTF-8"; 2 /*初始化*/ 3 blockquote, body, button, dd, dl, dt, fieldset, form, h1, h2, h3, h4, h5, h6, hr, input, legend, li, ol, p, pre, td, textarea, th, ul { 4 margin: 0; 5 pad... 阅读全文
posted @ 2019-06-30 16:17 疏影横斜水清浅 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 设置根元素 html{ font-size: 10px; } body{ font-size: 1.6rem; } #box1{ width: 20rem; height: 30rem; background-color: red; } #box2{ width: 25rem; height: 15 阅读全文
posted @ 2019-06-30 15:49 疏影横斜水清浅 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 5 6 42 43 44 45 1 46 2 47 3 48 49 50 阅读全文
posted @ 2019-06-30 15:41 疏影横斜水清浅 阅读(109) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 下一页