2020-03 front end technology summary

March 30, 2020 Monday # How to restore JSON data after it is transferred to Blob When axios requests to download the file interface, the responseType: 'blob' is generally set. If the file returns normally, there is no problem, but if there is a problem in the background file processing or authentication, the interface returns JSON format data ...

Posted by nitko on Mon, 31 Jan 2022 05:35:15 +0100

Node.js learning ten (url)

preface A complete url is divided into several parts, such as the following website:       http://www.tmooc.cn:80/detail.html?lid=5 It consists of the following protocol + domain name + port number + which file on the server to be requested + data passed to the server. Now let's learn about url in detail. 1, What is a url module The ur ...

Posted by s3rg1o on Sat, 29 Jan 2022 06:16:19 +0100

Node.js socket end, finish, close events and stream

Source text: https://github.com/cool-firer/docs/blob/main/node.js_socket_stream.md   net socket and stream events Test procedure tcp_server.js view code const net = require('net'); net.createServer(function(c) { console.log('conneceted'); c.on('finish', function() { console.log('finish 111'); }) c.on('close', function() { ...

Posted by Kerry Kobashi on Thu, 27 Jan 2022 12:46:47 +0100

Generate Excel spreadsheet from the server (Node.js+SpreadJS)

Node.js is a JavaScript running environment based on Chrome V8 engine, which is usually used to create web applications. It can handle multiple connections simultaneously and is not thread dependent like most other models. For Web developers, the scenario of obtaining data from a database or Web server and then outputting it to an Excel file f ...

Posted by shadow1200 on Wed, 26 Jan 2022 14:24:17 +0100

Build a graphql project, and the front end can specify the data returned by the interface at will

preface Last class, I mentioned that I wanted to use it directly Online mlab Build the database, but the online mlab has been unable to log in normally (or it's hard to log in, but it's cloud mongodb, which charges), so these days are delayed, so we can only choose to install mongodb locally. Briefly introduce the local installation steps of m ...

Posted by ixos on Wed, 26 Jan 2022 11:59:45 +0100

Node.js day 3

catalogue Promise object Synchronous asynchronous in Promise Using Promise to resolve callback hell Promise package Third party then FS solution callback hell async and await keywords async keyword await keyword async and await resolve callback hell 4. async and await read JSON file cases Promise object An object added in ES6 is ma ...

Posted by welshy123 on Wed, 26 Jan 2022 07:57:23 +0100

About node JS Buffer

The JavaScript language itself has only string data types and no binary data types. However, binary data must be used when processing such as TCP stream or file stream. Therefore, in node JS, a Buffer class is defined, which is used to create a cache for storing binary data. On Node JS, the Buffer class is a core library published with the No ...

Posted by Sneo on Wed, 26 Jan 2022 00:59:39 +0100

2021-7-6: http development web server

web server When an application (client) needs a resource, it can obtain the resource from a server through Http request; The server that provides resources is a Web server; First experience // Introduce http module const http = require('http') // Create a web server const server = http.createServer((req, res) => { res.end('Hello Http') ...

Posted by Pehape on Mon, 24 Jan 2022 18:36:30 +0100

node.js: create a Web server using Express

Express is a node based JS developed specifically to create a Web server framework. Its function is similar to that of node JS is similar to the built-in http module, or it is based on node JS is developed with built-in http module. Its relationship with http module is similar to that between Jquery and web API, but it is more efficient and pow ...

Posted by Hyperjase on Mon, 24 Jan 2022 06:34:54 +0100

One hour: teach you how to get started

express brief introduction Express is based on node JS platform, a fast, open and minimalist web development framework. Build web server The essence of Express: it is a third-party package on npm, which provides a convenient way to quickly create a Web server. Using the Express development framework, you can easily and quickly create a Web ...

Posted by midge1970 on Sun, 23 Jan 2022 19:15:00 +0100