<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Node on 村边的池塘</title>
		<link>https://jerrywang1981.github.io/tags/node/</link>
		<description>Recent content in Node on 村边的池塘</description>
		<generator>Hugo</generator>
		<language>zh-CN</language>
		
		
		
		
			<lastBuildDate>Tue, 28 Mar 2023 18:52:12 +0800</lastBuildDate>
		
			<atom:link href="https://jerrywang1981.github.io/tags/node/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Axios Error Request Body Larger Than MaxBodyLength Limit</title>
				<link>https://jerrywang1981.github.io/post/node/axios-error-Request-body-larger-than-maxBodyLength-limit/</link>
				<pubDate>Tue, 28 Mar 2023 18:52:12 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/node/axios-error-Request-body-larger-than-maxBodyLength-limit/</guid>
				<description>&lt;h2 id=&#34;axios-error&#34;&gt;Axios error&lt;/h2&gt;&#xA;&lt;p&gt;Request Body Larger Than MaxBodyLength Limit&lt;/p&gt;&#xA;&lt;h2 id=&#34;solution&#34;&gt;solution&lt;/h2&gt;&#xA;&lt;p&gt;config axios maxContentLength/maxBodyLength to a large number or Infinity&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    const options = {&#xA;      url,&#xA;      //method: &amp;#39;post&amp;#39;,&#xA;      //...&#xA;      maxContentLength: Infinity,&#xA;      maxBodyLength: Infinity,&#xA;    };&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Blind Sql Injection</title>
				<link>https://jerrywang1981.github.io/post/node/blind-sql-injection/</link>
				<pubDate>Wed, 16 Nov 2022 09:29:06 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/node/blind-sql-injection/</guid>
				<description>&lt;h2 id=&#34;security&#34;&gt;Security&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Risk: It is possible to view, modify or delete database entries and tables&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Cause: Sanitation of hazardous characters was not performed correctly on user input&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Fix: Review possible solutions for hazardous character injection&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Reasoning: The test result seems to indicate a vulnerability because it shows that values can be appended to parameter values,&#xA;indicating that they were embedded in an SQL query. In this test, three (or sometimes four) requests are sent. The last&#xA;is logically equal to the original, and the next-to-last is different. Any others are for control purposes. A comparison of&#xA;the last two responses with the first (the last is similar to it, and the next-to-last is different) indicates that the&#xA;application is vulnerable.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;how-to-fix&#34;&gt;How to fix&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://sequelize.org/v5/manual/raw-queries.html&#34;&gt;https://sequelize.org/v5/manual/raw-queries.html&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;make sure to &amp;lsquo;replace&amp;rsquo;/&amp;lsquo;bind&amp;rsquo;&lt;/p&gt;</description>
			</item>
			<item>
				<title>React for Beginners</title>
				<link>https://jerrywang1981.github.io/post/react/react-for-beginners/</link>
				<pubDate>Fri, 25 Sep 2020 07:56:47 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/react/react-for-beginners/</guid>
				<description>&lt;h2 id=&#34;prerequesite&#34;&gt;Prerequesite&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;node&lt;/li&gt;&#xA;&lt;li&gt;javascript&lt;/li&gt;&#xA;&lt;li&gt;html&lt;/li&gt;&#xA;&lt;li&gt;css&lt;/li&gt;&#xA;&lt;li&gt;es6&lt;/li&gt;&#xA;&lt;li&gt;code editor&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;create-react-app&#34;&gt;create-react-app&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;npm install -g create-react-app&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;create-react-app app-name&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;react-component&#34;&gt;React component&lt;/h2&gt;&#xA;&lt;h3 id=&#34;state&#34;&gt;state&lt;/h3&gt;&#xA;&lt;p&gt;class component里面管理状态使用state&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;class Counter extends Component {&#xA;  state = {&#xA;    counter: 10,&#xA;    title: &amp;#34;this is demo&amp;#34;,&#xA;    products: [&#xA;      {&#xA;        id: 1,&#xA;        name: &amp;#34;ok&amp;#34;,&#xA;      },&#xA;      {&#xA;        id: 2,&#xA;        name: &amp;#34;bad&amp;#34;,&#xA;      },&#xA;    ],&#xA;  };&#xA;  // ..... other&#xA;}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h3 id=&#34;render&#34;&gt;render&lt;/h3&gt;&#xA;&lt;h3 id=&#34;jsx&#34;&gt;jsx&lt;/h3&gt;&#xA;&lt;h3 id=&#34;expression&#34;&gt;expression&lt;/h3&gt;&#xA;&lt;h3 id=&#34;attributes&#34;&gt;attributes&lt;/h3&gt;&#xA;&lt;h3 id=&#34;listarray&#34;&gt;list/array&lt;/h3&gt;&#xA;&lt;h3 id=&#34;conditional-rendering&#34;&gt;conditional rendering&lt;/h3&gt;&#xA;&lt;h3 id=&#34;handle-events&#34;&gt;handle events&lt;/h3&gt;&#xA;&lt;h3 id=&#34;binding-event-handlers&#34;&gt;binding event handlers&lt;/h3&gt;&#xA;&lt;h3 id=&#34;updating-state&#34;&gt;updating state&lt;/h3&gt;&#xA;&lt;h3 id=&#34;event-arguments&#34;&gt;event arguments&lt;/h3&gt;&#xA;&lt;h3 id=&#34;passing-data-to-component&#34;&gt;passing data to component&lt;/h3&gt;&#xA;&lt;h3 id=&#34;passing-children&#34;&gt;passing children&lt;/h3&gt;&#xA;&lt;h3 id=&#34;debug-react-app&#34;&gt;debug react app&lt;/h3&gt;&#xA;&lt;h3 id=&#34;props-vs-state&#34;&gt;props vs state&lt;/h3&gt;&#xA;&lt;h3 id=&#34;raising-and-handle-events&#34;&gt;raising and handle events&lt;/h3&gt;&#xA;&lt;h3 id=&#34;multiple-component-in-sync&#34;&gt;multiple component in sync&lt;/h3&gt;&#xA;&lt;h3 id=&#34;lifting-state-up&#34;&gt;lifting state up&lt;/h3&gt;&#xA;&lt;h3 id=&#34;functional-component&#34;&gt;functional component&lt;/h3&gt;&#xA;&lt;h3 id=&#34;destructure-arguments&#34;&gt;destructure arguments&lt;/h3&gt;&#xA;&lt;h3 id=&#34;lifecycle-hooks&#34;&gt;lifecycle hooks&lt;/h3&gt;</description>
			</item>
			<item>
				<title>Sequelize Bulk Create to return with primary key in Postgre</title>
				<link>https://jerrywang1981.github.io/post/node/sequelize-bulk-create-postgre/</link>
				<pubDate>Tue, 19 May 2020 20:00:37 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/node/sequelize-bulk-create-postgre/</guid>
				<description>&lt;h2 id=&#34;sequelize-data-model&#34;&gt;Sequelize data model&lt;/h2&gt;&#xA;&lt;p&gt;在使用 bulkCreate的时候，如果想在返回的数据中包括生成的id, 需要加上option, &lt;code&gt;{ returning: true }&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;    return CertificationEndUsers.bulkCreate(usersToInsert, { returning: true });&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;另外-postgresql中table-name包含双引号和不包含的竟然是不一样的两个table&#34;&gt;另外 postgresql中table name包含双引号和不包含的，竟然是不一样的两个table&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;&amp;#34;users&amp;#34;&#xA;users&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;比如这是两个table&lt;/p&gt;</description>
			</item>
			<item>
				<title>Angular Javascript Heap Out of Memory</title>
				<link>https://jerrywang1981.github.io/post/node/angular-javascript-heap-out-of-memory/</link>
				<pubDate>Thu, 14 May 2020 21:20:50 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/node/angular-javascript-heap-out-of-memory/</guid>
				<description>&lt;p&gt;如果启动angular的时候有报 Javascript heap out of memory错误，可以试着修改&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;node_modules/.bin/ng&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;加上 &lt;code&gt;--max_old_space_size&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#!/usr/bin/env node --max_old_space_size=4096&#xA;&amp;#39;use strict&amp;#39;;&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
			</item>
			<item>
				<title>Python Nest</title>
				<link>https://jerrywang1981.github.io/post/python/python-nest/</link>
				<pubDate>Sat, 11 Apr 2020 21:15:14 +0800</pubDate>
				<guid>https://jerrywang1981.github.io/post/python/python-nest/</guid>
				<description>&lt;h1 id=&#34;背景&#34;&gt;背景&lt;/h1&gt;&#xA;&lt;p&gt;最近有做一个nestjs的项目，用的nestjs实现的微服务，如果所有的功能都用node/nestjs写，那倒也没有什么问题了。可是有一个功能是需要用到机器学习，代码是用python写的，需要用python实现一个微服务，供nest app来调用，同时，python代码也需要调用nest 微服务来取得一些数据。这就比较尴尬了，在网上由于没有找到对应的python库，所以自己实现了一个。&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
