随笔分类 -  node.js

对node.js的学习笔记,及资料
摘要:1,编写xml代码 <?xml version="1.0" encoding="utf-8"?> <!-- 数据 头部 --> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="ht 阅读全文
posted @ 2021-06-02 15:37 阿向向 阅读(730) 评论(0) 推荐(0)
摘要:本人在node中上传文件到Git仓库时报错; 原因是 node_modules 的文件问题 1,解决方法;git 忽略 node_modules 修改 gitignore 这个文件 //修改gitignore 文件后提交 D:\node.jsFile>git add .gitignore D:\no 阅读全文
posted @ 2021-05-31 10:27 阿向向 阅读(86) 评论(0) 推荐(0)
摘要:1,安装驱动、模块 express npm install express 2,编写js代码 //导入express模块 const express = require('express'); //创建一个名为app的Express应用 const app = express(); //设置访问根路 阅读全文
posted @ 2021-05-31 09:22 阿向向 阅读(60) 评论(0) 推荐(0)
摘要:1, 全局安装express-generator npm install express-generator -g 2,创建名称为myapp的Express应用 express --view=pug myapp D:\node.jsFile\ch08\express-generator>expres 阅读全文
posted @ 2021-05-31 08:53 阿向向 阅读(371) 评论(0) 推荐(0)
摘要:1,准备工作: 安装MySQL2 驱动(库名称为mysql2 ): npm install mysql2 2,编写js代码: 2-1,数据库 查询 数据js代码 const mysql = require('mysql2') const connection = mysql.createConnec 阅读全文
posted @ 2021-05-30 11:28 阿向向 阅读(131) 评论(0) 推荐(0)
摘要:1,准备工作: 安装MySQL2 驱动(库名称为mysql2 ): npm install mysql2 2,编写js代码: // 隐式建立连接 var mysql = require('mysql2'); var connection = mysql.createConnection( { 'ho 阅读全文
posted @ 2021-05-30 11:05 阿向向 阅读(228) 评论(0) 推荐(0)
摘要:1,编写js代码 //引入包 // const mongoose = require('mongoose'); // 建立 到mongoDB 的连接 const mongoose = require('mongoose'); // mongoose.connect('mongodb://localh 阅读全文
posted @ 2021-05-26 22:16 阿向向 阅读(197) 评论(0) 推荐(0)
摘要:1,安装Mongoose驱动 cnpm install mongoose --save 2,编写js代码 //引入包 // const mongoose = require('mongoose'); // 建立 到mongoDB 的连接 const mongoose = require('mongo 阅读全文
posted @ 2021-05-24 09:07 阿向向 阅读(378) 评论(0) 推荐(0)
摘要:1,安装Mongoose驱动 cnpm install mongoose --save 2,编写js代码 // 建立 到mongoDB 的连接 const mongoose = require('mongoose'); // mongoose.connect('mongodb://localhost 阅读全文
posted @ 2021-05-24 08:50 阿向向 阅读(146) 评论(0) 推荐(0)
摘要:1,准备工作: 安装MySQL2 驱动(库名称为mysql2 ): npm install mysql2 2,编写js代码: // 显式建立连接 const mysql = require('mysql2'); //创建到数据库的连接 const connection = mysql.createC 阅读全文
posted @ 2021-05-23 23:07 阿向向 阅读(316) 评论(0) 推荐(0)
摘要:// TCP 服务器; const net = require('net'); let clientNo = 0; const server = net.createServer((client)=>{ clientNo++; console.log(clientNo + '号客服端已连接'); c 阅读全文
posted @ 2021-05-23 21:09 阿向向 阅读(183) 评论(0) 推荐(0)