work hard work smart

专注于Java后端开发。 不断总结,举一反三。
随笔 - 1158, 文章 - 0, 评论 - 153, 阅读 - 186万
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

02 2022 档案

摘要:1、动态输出 打开E:\study\openresty\openresty-1.19.9.1-win64 目录下的 conf/nginx.conf 文件 在server中增加一下代码 location /hello { default_type text/html; content_by_lua ' 阅读全文

posted @ 2022-02-25 17:51 work hard work smart 阅读(184) 评论(0) 推荐(0) 编辑

摘要:1、OpenResty在Window下安装 1)、 下载 下载地址: https://openresty.org/cn/download.html 选择 64 位 Windows: openresty-1.19.9.1-win64.zip 2) 解压 双击 nginx.exe 3)验证 localh 阅读全文

posted @ 2022-02-24 15:56 work hard work smart 阅读(146) 评论(0) 推荐(0) 编辑

摘要:1、fastify安装 npm i fastify --save 2、第一个服务器 main.js // 加载框架并新建实例 const fastify = require('fastify')({ logger: true }) //申明路由 fastify.get("/", function(r 阅读全文

posted @ 2022-02-19 21:07 work hard work smart 阅读(324) 评论(0) 推荐(0) 编辑

摘要:Nodejs中的函数与JavaScript类似。 匿名函数:samp11.js function execute(someFunction, value) { someFunction(value); } execute(function(word){ console.log(word) }, "H 阅读全文

posted @ 2022-02-18 15:54 work hard work smart 阅读(39) 评论(0) 推荐(0) 编辑

摘要:创建模块 hello.js exports.world = function(){ console.log("hello world"); } 引入模块samp9.js var hello = require("./hello"); hello.world(); 执行 PS E:\study\nod 阅读全文

posted @ 2022-02-18 15:45 work hard work smart 阅读(21) 评论(0) 推荐(0) 编辑

摘要:1、从流中读取数据 samp7.js var fs = require("fs"); var data = ''; // 创建可读流 var readerStream = fs.createReadStream('input.txt'); // 设置编码为 utf8 readerStream.set 阅读全文

posted @ 2022-02-18 15:21 work hard work smart 阅读(31) 评论(0) 推荐(0) 编辑

摘要:1、阻塞代码 创建文件input.txt, 内容为 hello world in input.txt 创建samp3.js var fs = require("fs"); var data = fs.readFileSync('input.txt'); console.log(data.toStri 阅读全文

posted @ 2022-02-18 14:07 work hard work smart 阅读(32) 评论(0) 推荐(0) 编辑

摘要:一、创建samp1.js 内容如下: console.log("Hello World"); 运行结果: PS E:\study\nodejs\demo1> node .\samp1.js Hello World 二、创建第一个应用 创建samp2.js var http = require("ht 阅读全文

posted @ 2022-02-18 13:03 work hard work smart 阅读(55) 评论(0) 推荐(0) 编辑

摘要:1、下载node.js https://nodejs.org/zh-cn/download/ 我这里选择的版本为 node-v14.16.1-x64.msi 下载完成后点击安装 阅读全文

posted @ 2022-02-17 10:57 work hard work smart 阅读(41) 评论(0) 推荐(0) 编辑

摘要:一、基本使用 1、基本路由实现 1).增加依赖包 <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-web</artifactId> <version>3.5.2</version> </dependency> 2)、创建一个Htt 阅读全文

posted @ 2022-02-15 23:37 work hard work smart 阅读(88) 评论(0) 推荐(0) 编辑

摘要:参考: https://www.liqinglin0314.com/article/479 https://blog.csdn.net/blueheart20/article/details/51601441 阅读全文

posted @ 2022-02-15 22:57 work hard work smart 阅读(118) 评论(0) 推荐(0) 编辑

摘要:Vert.x 最大的特点在于异步(底层基于Netty),通过事件循环(EventLoop)来调起存储在异步任务队列(CallBackQueue)中的任务,大大降低了传统阻塞模型中线程对操作系统的开销。异步模型能够很大程度的提高系统的并发量。 1、Vertx能做什么 Java能做的,Vert.x 都能 阅读全文

posted @ 2022-02-15 10:34 work hard work smart 阅读(1254) 评论(0) 推荐(0) 编辑

摘要:Vertx底层通信框架依赖于Netty,并封装了对Http协议的支持,因此可以非常方便的进行Web开发,且不依赖于任何中间件。 下面简单实现一个HttpServer 1、引入依赖 <dependency> <groupId>io.vertx</groupId> <artifactId>vertx-c 阅读全文

posted @ 2022-02-14 18:22 work hard work smart 阅读(274) 评论(0) 推荐(0) 编辑

摘要:一、lua基本语法 1、lua注释 --[[ print("hello lua"); --]] 2、lua标识符 标识符以一个字母A到Z,或者a到z或下划线,开头后加上0个或者多个字母,下划线,数字(0到9) 最好不要使用下划线加大写字母的标识符,因为lua的保留字也是这样的。 Lua不允许使用特殊 阅读全文

posted @ 2022-02-13 20:10 work hard work smart 阅读(355) 评论(0) 推荐(0) 编辑

摘要:在Idea安装Lua插件Emmylua,安装完成后重启IDE 创建lua工程 File-> New Project, 选择lua 创建lua文件 helloworld.lua 编写lua文件,打印hello lua 运行lua文件 参考: 文档:https://www.runoob.com/lua/ 阅读全文

posted @ 2022-02-13 13:41 work hard work smart 阅读(187) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示