jjw

写给自己的博客。 记录学习的点滴以备查。
随笔 - 127, 文章 - 0, 评论 - 8, 阅读 - 62632
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
< 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

07 2023 档案

摘要:typeorm中的createContection已经被废弃,改为DataSource,dataSource.initialize()方法会连接数据库,返的是个promise. const con = new DataSource({ type: 'mssql', ...options, optio 阅读全文

posted @ 2023-07-12 17:53 jjw 阅读(18) 评论(0) 推荐(0) 编辑

摘要:const fp = require('fastify-plugin') const { DataSource } = require('typeorm') function dbPlugin(fastify, options, done) { const con = new DataSource( 阅读全文

posted @ 2023-07-12 17:49 jjw 阅读(10) 评论(0) 推荐(0) 编辑

摘要:const routes = (fastify, options, done) => { fastify.post('/login', async (request, reply) => { return 'ok' }) fastify.get('/getBooks', async (request 阅读全文

posted @ 2023-07-12 17:43 jjw 阅读(15) 评论(0) 推荐(0) 编辑

摘要:fastify.addContentTypeParser('application/mydata', { parseAs: 'string' }, function (req, body, done) { try { //对数据进行处理, done(null, body) } catch (err) 阅读全文

posted @ 2023-07-12 17:31 jjw 阅读(30) 评论(0) 推荐(0) 编辑

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