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 […]

threejs(7)-Proficient in particle effects

1. First introduction to Points and point materials //Set point material const pointsMaterial = new THREE.PointsMaterial(); import * as THREE from “three”; //Import track controller import {<!– –> OrbitControls } from “three/examples/jsm/controls/OrbitControls”; //Import animation library import gsap from “gsap”; //Import dat.gui import * as dat from “dat.gui”; // Goal: get to know points const gui […]

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) […]

Why should vue front-end projects use Nodejs?

1. Traditional JavaScript Traditional js runs on the browser, because the browser kernel is divided into two parts: Rendering engine-renders HTML and CSS, JavaScript engine-responsible for running JavaScript With the development of technology, the JavaScript engine used by Chrome is V8, which is very fast and has good performance. At the same time, Node.js, developed […]

NodeJS crawls design pictures on Ink Knife

Background The designer shared a prototype of the ink knife, but it was given read-only permission and the materials could not be downloaded. During development, I wanted to download an animated picture inside, and found the image address in the page structure through the browser’s F12 tool. However, after direct access by the browser, it […]

Implement multi-part upload, resume upload, and instant upload (JS+NodeJS) (TypeScript)

1. Introduction and effects Uploading files is a very common operation, but when the file is large, the upload will take a very long time, and the upload operation will be uncertain. If the connection is accidentally disconnected, the file It will need to be uploaded again, resulting in wasting time and network resources. Therefore, […]

HarmonyOS development: NodeJs script implements component-based dynamic switching

Foreword In the last article, we used NodeJs script to complete the componentized operation of the HarmonyOS project. However, since the script was developed based on the 4.0.0.400 version of DevEco Studio, there may be some differences in the modification of the configuration file. So what should we do if we encounter this situation? One […]