Hi I’m Shendi Nodejs column Nodejs operation cache database-Redis In server-side development, cache database is also indispensable, which can improve program concurrency and facilitate subsequent expansion. Currently, the most commonly used one is Redis. Install dependencies Like the previous mysql, the most commonly used dependency of redis is redis npm install redis Depend on the […]
Tag: nodejs
Use of Nodejs database-Mysql
Hi I’m Shendi Use of Nodejs database-Mysql Nodejs column The database is indispensable in the backend, and Nodejs naturally has libraries corresponding to the database to use. Mysql database can use the mysql library Install dependencies Execute the following command to install mysql dependencies npm install mysql Depend on the corresponding github address: https://github.com/mysqljs/mysql Introduce […]
Use Nodejs to build a simple web page and achieve public network access
Table of Contents Preface 1. Install Node.js environment 2. Create a Node.js application 3. Install Cpolar intranet penetration to achieve public network access to Nodejs services 3.1 Register cpolar account 3.2 Download cpolar client 3.3 Create tunnel mapping local port 4. Fixed public network remote address Foreword Node.js is a web application framework built on […]
nvm realizes the coexistence of multiple versions of nodejs under windows
Table of Contents 1.Install nvm 1.1 Download the installation package 1.2 Install nvm 1.3 Configure nvm to download the image 1.4 Configure nvm environment variables 2. Use nvm 2.1 Basic commands 2.2 Use nvm to download nodejs 3.npm configure global dependencies and cache dependencies (optional) 4. Install commonly used modules 4.1 Install express 4.2 Install […]
nodejs operates rabbitMQ rascal library (encapsulation for amqplib)
Rascal is a rich pub/sub wrapper around amqplib. One of the best things about amqplib is that it makes no assumptions about how you use it. Another is that it doesn’t attempt to abstract AMQP Concepts. Therefore, the library provides a lot of control and flexibility, but it is your responsibility to adopt appropriate patterns […]
Nodejs quickly builds a simple HTTP server and publishes remote access to the public network
Article directory Preface 1. Install Node.js environment 2. Create node.js service 3. Access node.js service 4.Intranet penetration 4.1 Install and configure cpolar intranet penetration 4.2 Create tunnel mapping local port 5. Fixed public network address Before I start the text, I would like to recommend a website to you. A few days ago, I discovered […]
Nodejs__code__streamline__Ajax interaction
Introduction: Full name Ajax (Asynchronous Javascript And XML) Function 1. Update content without refreshing the page 2. A method of communication between the browser and the server Commonly used parameters: XMLHttpRequest A constructor used to implement asynchronous communication between the browser and the server Example: let xhr=new XMLHttpRequest() readyState Represents the status of XMLHttpRequest 0 […]
[Case Combat] NodeJS+Vue3+MySQL implements list query function
This article brings you a list query function and a comprehensive case study from front-end to back-end. Use vue3 as front-end development and nodejs as back-end development. First, let’s take a look at the completed page effect. Click paging to switch to the previous page and next page. The search box allows for fuzzy queries. […]
NodeJS callback hell and Promise optimization
There are many asynchronous APIs in NodeJS, such as the common readFile method of the fs module. Although there is a synchronous version of readFileSync, its performance is definitely not as good as the former. So let’s start with the asynchronous version of readFile: const fs = require(‘fs’); fs.readFile(‘./a.txt’, ‘utf-8’, function(error, data) { if (!error) […]