koa onion model

Analysis 1. First, this is the easiest example to get started with koa2. I will show you the onion model of koa2 with this example. const Koa = require('koa'); const app = new Koa(); app.use((ctx,next)=>{ console.log("First Middleware Execution"); next() ; }); // Second Middleware app.use((ctx,next)=>{ console.log("Second ...

Posted by savj14 on Fri, 24 May 2019 09:36:04 -0700

How Node.js asynchronously determines whether a file exists or not

Usually when we talk about Node. js, we talk about asynchrony. In fact, Node.js performs asynchronous calls in different scenarios. This article will analyze how Node. JS makes asynchronous calls through libuv thread pool through libuv source code. The Node.js version described in this article is v11.15.0 The libuv version is 1.24.0 . Take the ...

Posted by filburt1 on Sat, 18 May 2019 15:25:44 -0700

hapi framework building records: Joi data checks and Sequelize (data migration, data filling)

hapi framework, using Official Web In short, Hapi is a rich framework for building applications and services that enables developers to focus on writing reusable application logic rather than spending time building infrastructure. In my own words, it is a node service infrastructure like express, koa. This blog was read in the gold digging Br ...

Posted by YAOMK on Fri, 03 May 2019 00:00:38 -0700

Deploy novel api service to Tencent cloud

The novel API version 1.0 is finished, and then it is deployed to the server, using nginx, pm2, nvm, git, OpenSSL. Server configuration: CentOS 7.4 64 bit 1 core 2 GB 1 Mbpsnode version: 8.9.0nvm version: 0.33.11npm version: 5.5.1nginx version: 1.12.2git version: 2.9.5 The first step is to add the pm2 configuration file Create a pm2.json file i ...

Posted by Jove on Sun, 28 Apr 2019 00:40:36 -0700

Chinese Details of Congtx.yaml

Configtx.yaml is a Hyperledger Fabric block chain network operation and maintenance tool configtxgen used to generate channel creation blocks or channel transactions configuration files. The content of configtx.yaml directly determines the content of the generated generation blocks. This article will give a detailed Chinese description of confi ...

Posted by sparklehorse7 on Thu, 25 Apr 2019 11:12:35 -0700

Xiaobai Full Stack Development I

Xiaobai Full Stack Development I brief introduction From a beginner's point of view (vue, Koa and Express) Starting from 0, build a single page front-end project that provides data through RESTful API and consists of vue. I hope I can help you, like me, who are all white stacks. (I have read many articles about how to build the whole stack, som ...

Posted by garfield213 on Sat, 13 Apr 2019 10:57:31 -0700

Use Electron to handle form crashes and hangs

Use Electron to handle form crashes and hangs Application examples for this series of articles have been published GitHub: electron-api-demos-Zh_CN Clone or run it after downloading. Welcome to Star. The Browser Window module will issue events when the renderer process crashes or hangs. You can listen for these events and reload them to the us ...

Posted by Masna on Sat, 06 Apr 2019 13:33:30 -0700

The gulp article of the front-end engineering chapter makes it easy for you to master gulp [full set of gulp source annotation parsing]

gulp is a build tool that runs on a Node.js-based platform using the modular syntax of commonJs. We use packages that gulp needs A TASK task, corresponding to a package, corresponding to a processing logic, gulp.series corresponds to synchronous tasks, which are executed from left to right in turn. Long time gulp.parallel corresponds to async ...

Posted by khovorka on Sun, 24 Mar 2019 20:33:28 -0700

Weex introductory tutorial 3, using Vue to develop Weex pages

Environmental installation Here is a brief introduction and a detailed look. rom Node.js environment Node.js official website Normally, with the Node.js environment installed, the npm package management tool is installed. Therefore, use npm directly to install weex-toolkit. npm is a JavaScript package management tool that allows deve ...

Posted by jmcall10 on Sun, 24 Mar 2019 13:12:27 -0700

Node.js connects to MongoDB.

MongoDB, the representative of NoSQL, has been very popular recently. Although some functions are not perfect, it does not affect its fire. Node.js is a JS language written in JavaScript that can run on the server side. So, what kind of spark will the collision produce? Today, I'll give you a simple example of how to create a new database fi ...

Posted by Tainted Kitten on Sat, 23 Mar 2019 22:27:27 -0700