NestJs Learning Tour-Interceptor

Welcome to NestJs Travel Series Interceptor is a class that implements the NestInterceptor interface and is decorated by the @Injectable decorator. Interceptor is an application based on AOP programming idea. The following are commonly used functions: Execute additional logic before or after method execution, which is generally not part of t ...

Posted by greenba on Tue, 10 Sep 2019 01:18:11 -0700

The node service starts from egg on the back end of the full stack project

1 technology stack egg+node Project Online Address http://47.100.30.67:7001 Project git address https://github.com/jiqingpeng/mars/tree/master/fe/egg-example 2 Quick Start egg officially recommends that scaffolding be used directly and that projects can be generated quickly with a few simple instructions (npm > = 6.1.0): mkdir egg-exam ...

Posted by jungalist on Wed, 04 Sep 2019 22:42:00 -0700

mongodb / morgan save log

Save logs in log files // app.js var logger = require('morgan'); var fs = require('fs') var logDirectory = path.join(__dirname, 'log') fs.existsSync(logDirectory) || fs.mkdirSync(logDirectory) var accesLogStream = FileStreamRotator.getStream({ date_format: 'YYYYMMDD', filename: path.join(logDirectory, 'access-%DATE%.log'), frequency: 'dai ...

Posted by newjsguy on Fri, 30 Aug 2019 21:54:39 -0700

NestJs Learning Tour-Pipeline

Welcome to NestJs Learning Tour Series The Conduit Partners familiar with Linux commands should be familiar with "pipe operators". ls -la | grep demo "|" is the pipe operator, which passes the output of the left command as input to the right command and supports cascading, so that complex commands can be alternated by the p ...

Posted by avvllvva on Wed, 28 Aug 2019 00:02:36 -0700

NestJs Learning Tour-Routing Guard

Welcome to NestJs Learning Tour Series Traditional Web applications to detect user login, privilege judgment and so on are done in the controller layer or middleware layer. In the current recommended modular and component architecture, functional recommendations of different responsibilities are split into different class files. NestJs has don ...

Posted by BoarderLine on Tue, 27 Aug 2019 01:09:38 -0700

NestJs Learning Tour-Modular System

Welcome to NestJs Travel Series Modular Modules in NestJs are the basic elements for building and organizing business units. Decorative module @Module() is used to declare the meta-information of the module: Which service providers are exported by this module Which dependency modules are imported into this module Which controllers are provided ...

Posted by TheBeginner on Wed, 21 Aug 2019 22:01:58 -0700

Webpack 4.0 Gets Into Deep

webpack4.0 (1) Installation and use of webpack 1. Introduction webpack is a packaging tool, which handles js files by default, can also handle other types of files with loaders, and can simplify our development process with plug-ins. 2. Configuration environment First install the preparation environment, node, because webpcak is a node-based pa ...

Posted by yumico23 on Tue, 20 Aug 2019 22:07:36 -0700

Node.JS Recognizes Picture Types

Nodejs Recognizes Picture Types It is inaccurate to obtain the image format by cutting the suffix of the file name, because the file suffix can be changed forcibly, and such a. gif picture can also be saved as. jpg. So how do we do file type checking on Node? Judging Picture Format by File Header Identification In fact, it is very simple, each ...

Posted by riginosz on Wed, 14 Aug 2019 07:17:33 -0700

Koa2 Introduction Tutorial

Full Demo Address The demo was written by myself, so I can't guarantee it will run until there are environmental problems.If you are too lazy to write, move on and read the article. Most of the code even gives you the output information.koa-demo Introduction to Official Website Created by Express's original team, koa is dedicated to becoming a ...

Posted by maineyak on Tue, 13 Aug 2019 09:09:28 -0700

Using session within the express framework

The last article mentioned the shortcomings of cookie s and suggested that session is one way to solve the shortcomings.This article tells you how to use session. The author used the file save session method.If you don't want to save in memory or database, remember to use the appropriate module. Below are two ways to use memory storage and fil ...

Posted by citricsquid on Tue, 30 Jul 2019 09:24:20 -0700