surmon-china / nodepress Goto Github PK
View Code? Open in Web Editor NEW🟢 RESTful API service for https://surmon.me blog, powered by @nestjs
Home Page: https://github.surmon.me/nodepress
License: MIT License
🟢 RESTful API service for https://surmon.me blog, powered by @nestjs
Home Page: https://github.surmon.me/nodepress
License: MIT License
[error] [nodepress] (node:10300) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/Users/geekchief/Desktop/Work/Workspace/Geekkampong/gm/surmon.me/public/rss.xml'
at Object.openSync (fs.js:476:3)
at Object.writeFileSync (fs.js:1467:35)
at /Users/geekchief/Desktop/Work/Workspace/Geekkampong/gm/blog-api/dist/modules/syndication/syndication.service.js:198:30
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 1)
yarn start后,报这个错误,rss.xml怎么编写?有没有样例,需要帮助,感谢感谢!
[email protected] start:dev /Applications/MAMP/htdocs/nodepress
NODE_ENV=development nodemon
[nodemon] 1.18.7
[nodemon] to restart at any time, enter rs
[nodemon] watching: /Applications/MAMP/htdocs/nodepress/src/**/*
[nodemon] starting ts-node -r tsconfig-paths/register src/main.ts
/Applications/MAMP/htdocs/nodepress/node_modules/ts-node/src/index.ts:261
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
src/modules/expansion/expansion.service.qiniu.ts(24,42): error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.
src/modules/expansion/expansion.service.qiniu.ts(25,47): error TS2322: Type 'unknown' is not assignable to type 'string'.
是需要配七牛的配置app.config.ts
export const QINIU = {
accessKey: argv.qn_accessKey || 'your access key',
secretKey: argv.qn_secretKey || 'your secret key',
bucket: argv.qn_bucket || 'nodepress',
origin: argv.qn_origin || 'http://nodepress.u.qiniudn.com',
uploadURL: argv.qn_uploadURL || 'http://up.qiniu.com/',
};
能否给测试数据
我有一个需求, 想判断如果用户jwt满足刷新条件(比如生成超过1天且未过期)就在接口返回中返回一个新的token。
我能想到的做法是建立一个拦截器,判断并为返回结果加上新token。 可是拦截器似乎不支持依赖注入,就没法获得必须的模块(缓存和用户服务)。
有什么好建议么😯
請問有沒有方法可以seed data?
例如像 laravel 那樣有指令可進行 seed 匯入或 遷移轉換資料
�
或者可自訂指令來執行呢?
大神,我最近也在搭建博客,后端和数据库不怎么会,可以参考一下大神的数据库设计吗?
hi
yarn 一直出现Gyp 的问题
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
多数关于 Vs , 是一定要用 visual studio 才能运行吗? 应该不是吧?
麻烦问一下作者,这个打包部署需要去服务器吗?我看本地npm run build 之后出来的dist不对,然后参考了百度的结果,说是去服务器上面打包,因为本地指向依赖包问题
参考文献:https://www.cnblogs.com/xianxiaobo/p/12162309.html
npm install error : 依赖的包(ssh://github.com/surmon-china/mongoose-paginate.git)不存在
i@mingbai:~/node/nodepress$ npm install
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/surmon-china/mongoose-paginate.git
npm ERR!
npm ERR! Permission denied (publickey).
npm ERR! fatal: 无法读取远程仓库。
npm ERR!
npm ERR! 请确认您有正确的访问权限并且仓库存在。
npm ERR!
npm ERR! exited with error code: 128
我查看了相应的git地址,好像没有这个项目。换成其他开源的同名项目,并且把ssh 协议改为http,可以正常运行,但是不知道这么改是否合适,也不太明白为什么会有ssh的依赖,故有此一问。
作者您好,阅读了您的代码有了,但是发现jwt好像没有做续签,不知道是不是我没有找到相关位置。
加入 swagger 接口展示和调试都可以方便直观很多
NODE_ENV=production rimraf dist && tsc
src/decorators/query-params.decorator.ts:89:25 - error TS2538: Type 'ITransformConfigObject' cannot be used as an index type.
89 transformConfig[field] = true;
~~~~~
src/modules/category/category.service.ts:145:65 - error TS2339: Property '_id' does not exist on type 'unknown'.
145 .find({ _id: { $in: Array.from(categories, c => c._id) }})
~~~
Found 2 errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] prestart:prod: NODE_ENV=production rimraf dist && tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] prestart:prod script.
在本地测试全部正常
请问下大佬,有这关于nodepress部署到linux服务器上的教程吗?第三方也行。
graphql 替代 restful 也是趋势了
node_modules/mongodb/mongodb.d.ts:3309:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
Type 'void' is not assignable to type 'this'.
'this' could be instantiated with an arbitrary type which could be unrelated to 'void'.
3309 end(): void;
~~~
node_modules/mongodb/mongodb.d.ts:3310:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
3310 end(chunk: Buffer): void;
~~~
node_modules/mongodb/mongodb.d.ts:3311:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
3311 end(callback: Callback<GridFSFile | void>): void;
~~~
node_modules/mongodb/mongodb.d.ts:3312:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
3312 end(chunk: Buffer, callback: Callback<GridFSFile | void>): void;
~~~
node_modules/mongodb/mongodb.d.ts:3313:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
3313 end(chunk: Buffer, encoding: BufferEncoding): void;
~~~
node_modules/mongodb/mongodb.d.ts:3314:5 - error TS2416: Property 'end' in type 'GridFSBucketWriteStream' is not assignable to the same property in base type 'Writable'.
Type '{ (): void; (chunk: Buffer): void; (callback: Callback<void | GridFSFile>): void; (chunk: Buffer, callback: Callback<void | GridFSFile>):
void; (chunk: Buffer, encoding: BufferEncoding): void; (chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<...>): void; }' is not assignable to type '{ (cb?: (() => void) | undefined): this; (chunk: any, cb?: (() => void) | undefined): this; (chunk: any, encoding: BufferEncoding, cb?: (() => void) | undefined): this; }'.
3314 end(chunk: Buffer, encoding: BufferEncoding | undefined, callback: Callback<GridFSFile | void>): void;
src/processors/helper/helper.service.akismet.ts:34:19 - error TS2709: Cannot use namespace 'akismet' as a type.
34 private client: akismet
~~~~~~~
src/processors/helper/helper.service.akismet.ts:44:27 - error TS2339: Property 'client' does not exist on type 'typeof import("akismet-api")'. smet-api")'.
44 this.client = akismet.client({
~~~~~~
最好可以贴下配置文件
`D:\web\nodepress-master>cnpm run dev
[email protected] dev D:\web\nodepress-master
nodemon --exec "set NODE_ENV=development node --harmony
[nodemon] 1.11.0
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting set NODE_ENV=development node --harmo [nodemon] clean exit - waiting for changes before restart
这样是正常的吗? 我用的是WINDOW 。请指点
感谢作者大大的付出,谢谢。
本人目前主要从事前端方面的工作,但是对后端也很感兴趣,前段时间仔细看了看egg.js和koa这些框架,但是没怎么整明白,一些helloworld可以跑起来,但是像大佬这种就不行了,所以希望大佬出一个简易教程,我想先让它跑起来,然后再仔细琢磨。
万分感谢。
可否说说七牛怎么在angular4中使用?
model里的pre钩子只有save,少了update吧,不然更新的时候没有触发更新update_time的,而且我这边更新update_time是用的this.update({...})方法,直接用this.update_time = ...不起作用
你好我发现用了你的http.decorator.ts然后再加swagger编译报错,
具体报什么错也没有提示,只是编译界面直接显示Error
自己也想建一个博客,在github上搜索到这个项目。感觉功能和代码都很赞,想fork之后直接投入使用(可能会做一些修改),但没有看到相关开源协议,就开个issues询问一下是否可以。
Object.is(gteDate, 'Invalid Date'),getDate(Invalid Date)是个对象,这个式子一直是false
$ cross-env NODE_ENV=production node -r ./tsconfig-paths-bootstrap.js dist/main.js
error Command failed with exit code 1.
程序直接退出了并没有运行成功 也没有排查错误信息的日志 能帮忙看下问题么
[error] [nodepress] (node:88584) UnhandledPromiseRejectionWarning: Error: ENOENT: n
o such file or directory, open 'E:\Study\surmon.me\public\sitemap.xml'
at Object.openSync (fs.js:457:3)
at Object.writeFileSync (fs.js:1282:35)
at E:\Study\nodepress-master\dist\modules\syndication\syndication.service.js:192
:30
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Promise.all (index 0)
[error] [nodepress] (node:88584) UnhandledPromiseRejectionWarning: Unhandled promis
e rejection. This error originated either by throwing inside of an async function wi
thout a catch block, or by rejecting a promise which was not handled with .catch().
To terminate the node process on unhandled promise rejection, use the CLI flag --un handled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_reject
ions_mode). (rejection id: 1)
[error] [nodepress] (node:88584) [DEP0018] DeprecationWarning: Unhandled promise re
jections are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
[warn] [nodepress] 邮件客户端初始化连接失败!将在半小时后重试: Invalid login: 535
Login Fail. Please enter your authorization code to login. More information in http:
//service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no=1001256
[warn] [nodepress] Akismet 验证失败!无法工作,原因: Akismet Key 无效!
该如何解决呢?
看你项目描述,好想看看你的项目在线上的样子,可是怎么都打不开?
你好,从你的开源代码中学到很多,非常感谢!
数据流异常拦截器按照 README
的描述是:当控制器所需的 Promise service 发生错误时,错误将在此被捕获
有两个个疑问:
CustomException
),仅仅是这样的需求的话,为什么不直接通过过滤器(HttpExceptionFilter
)捕获错误呢?因为拦截器抛出的异常(CustomException
)最终依然是交给过滤器(HttpExceptionFilter
)来处理,而过滤器的第一个参数 exception
是有完整的错误信息的throwError(new CustomException({ message, error }, statusCode));
,这样的写法会导致在终端中打印出 抛出异常的无效堆栈信息我在生产环境中并没有关闭 NestJS
的 Logger
,所以我在 HttpExceptionFilter
中多加了些打印日志
Logger.error(
`${request.method} ${request.url}`,
JSON.stringify(errorResponse),
'HttpExceptionFilter',
);
作者您好,看到您关于博客的三个开源项目:前端、后端、后端管理这三个项目,想搭建跑起来学习一下,请问这三个项目怎么一起跑起来呢?比如nodepress这个项目,这个项目对应的数据我该如何建表或者库,有没有直接的sql可以使用?非常感谢
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.