腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
3
回答
typescript
和
express
js
。
更改
res
json
`
Response
`
类型
node.js
、
typescript
、
express
、
type-declaration
在
typescript
中,我试图覆盖
express
的
Response
json
对象,使其成为始终使用的特定
类型
的对象 例如,我希望强制使用一个接口
类型
,如果不遵循以下格式,该接口
类型
将会出错 return
res
.status(200).
json
({ success: true, }); 我尝试使用dts
浏览 71
提问于2020-07-05
得票数 2
回答已采纳
2
回答
模块没有导出的成员“Request”
javascript
、
express
,
Response
, Application } from '
express
'; // <-- Error here 出现错误(用于'Request'、'
Response
'
和
'Application我看到在node_modules中,文件request.
js
、
response
.
js
和
application.
js
列在/lib子目
浏览 363
提问于2019-10-19
得票数 4
回答已采纳
2
回答
与方法定义相关联地向方法添加属性的
类型
记录成语
attributes
、
typescript
类型
记录中是否有与方法定义一致的类中方法的属性定义?class FooController { }
浏览 1
提问于2015-03-29
得票数 1
回答已采纳
2
回答
如何为函数的参数文档插入
类型
记录提示
node.js
、
typescript
、
express
、
visual-studio-code
如果我创建了一些
Express
.
js
中间件,我如何让我的编辑器(VSCode)提供
类型
记录提示,就好像我直接引用了库一样?const
express
= require('
express
'); * * @param {
Express
.Re
浏览 4
提问于2018-08-03
得票数 0
3
回答
如何使用导入(而不是require )创建快速应用程序
typescript
、
express
import { Request,
Response
, Application } from '
express
'; const
express
= require('
express
'); app.get('/', function (req: Reque
浏览 0
提问于2019-03-06
得票数 9
回答已采纳
1
回答
如何使用
typescript
扩展
express
对象?
node.js
、
typescript
、
express
当我编译
typescript
项目时,我没有看到
express
import import {Request,
Response
}。现在我正在尝试使用require,但不确定如何扩展
express
对象并使用req
和
res
。任何帮助都将不胜感激。index.tsimport
express
= requir
浏览 2
提问于2018-05-31
得票数 0
3
回答
TypeScript
快速错误函数
typescript
、
express
、
typescript-typings
在
Typescript
中编码时,错误处理函数的四个参数
类型
是什么? app.use((err: ??, req: ??,
res
: ??, next: ??)错误显示“参数隐式具有'any‘
类型
”。实际上,我对这条消息感到困惑。如果它将其视为any
类型
,那么这不是一个有效的选择吗?
浏览 1
提问于2018-05-08
得票数 15
回答已采纳
1
回答
使用
typescript
for Node.
js
在本地主机上看不到任何内容
node.js
、
typescript
、
express
下面是我的代码:注意:我还在学习
typescript
和
其他东西,所以让我知道其他东西,我应该做得更好!Request,
Response
} from "
express
"; //GET ROUTE for /meals/ router.get("/", (req: Request,
res
:
Response
, nex
浏览 5
提问于2021-08-26
得票数 1
1
回答
如何正确地扩充
Express
类型
?
typescript
、
express
我有一个文件:types/
express
.d.ts export interface
Response
{ }在app.
js
中 return this.
json
({
浏览 0
提问于2019-04-16
得票数 1
回答已采纳
1
回答
Post req.body始终为空对象
node.js
、
typescript
、
post
我使用
Typescript
Fetch包装器来做post
和
get请求,并在post时获取空对象(get工作得很好)(在我使用Vanilla
Js
之前,一切都工作得很好) Nodejs: const
express
= require('
express
');app.use(function (req,
res
,',
浏览 62
提问于2021-10-31
得票数 0
回答已采纳
1
回答
在
express
中的req
和
res
的
类型
?
javascript
、
node.js
、
typescript
、
rest
、
express
我正在尝试对req,
res
参数使用DefintelyTyped、
和
类型
。但是,这不能编译:const app =
express
();
res
.send('Hello
Express</e
浏览 26
提问于2019-10-26
得票数 2
回答已采纳
1
回答
在
Express
中自定义响应结构中未签入的
类型
javascript
、
node.js
、
typescript
、
express
我从
类型
记录开始,遇到了一个障碍,我不知道为什么
类型
没有被验证。路由 // here 404 is a string but should be a number according: any
r
浏览 1
提问于2022-08-27
得票数 0
回答已采纳
1
回答
Express
.
js
/ type
Typescript
: Error TS2339:属性'send‘在
类型
'
Response
’上不存在
node.js
、
typescript
、
express
// package.
json
"
express
": "^4.17.1" "devDependencies": { "tslint": "^5.12.0", "
typescript
&q
浏览 2
提问于2019-11-29
得票数 15
回答已采纳
2
回答
反应不能从
express
.
js
获得
javascript
、
node.js
、
reactjs
、
express
我试图将我的react.
js
前端连接到后端的
express
.
js
服务器,但是我得到了这个错误。"proxy": "http://localhost:3001",const
express
= require('
express
');const port = 3001; a
浏览 0
提问于2021-07-22
得票数 0
2
回答
如何在打字本中添加扩展函数来表示响应?
typescript
、
express
我想在
Express
中扩展响应,以包括自定义函数。我想添加一个函数:所以我可以在任何地方调用它,比如
response
.sendError(500我是
TypeScript
的新手,所以请原谅我在问题中可能犯的错误:)
浏览 4
提问于2021-07-05
得票数 1
6
回答
如何将
Typescript
定义添加到
Express
req &
res
node.js
、
express
、
typescript
对于我的REST API,我有一组控制器函数,并且我得到了很多如下内容
res
也是如此例如,下面的Request
类型
参数不起作用。/// <reference path="../../..typings/tsd.d.ts" /> /*
浏览 2
提问于2015-12-29
得票数 27
2
回答
如何指定
Express
响应返回的
类型
typescript
、
express
我正试图在我的
express
.
js
web应用程序中与
TypeScript
一起标准化响应,我不太确定,我如何在全球范围内设置响应,例如,响应应该是这样的界面: success: boolean,: string,现在我只是在写: try { registerResponse= await register(req.body.email, req.body
浏览 0
提问于2018-03-06
得票数 4
回答已采纳
3
回答
在NodeJS应用程序中表示不使用打字本
node.js
、
typescript
、
express
我正在学习
类型
记录,我按照教程逐字使用它
和
express
应用程序,但是我得到了以下错误:const app: Application =
express
();TypeError:
express
_1.default is not a functionapp.ts文件: import
express
, { A
浏览 17
提问于2020-02-27
得票数 4
回答已采纳
2
回答
Typescript
/ Eslint在我开始的每个项目中抛出“无法读取文件tsconfig.
json
”
node.js
、
typescript
、
express
、
eslint
在其他线程中,我看到当eslint
和
tsconfig.
json
不在同一个工作文件夹时,可能会出现问题,但是我在项目的根文件夹中有所有的文件。(看起来像在"main“中将index.
js
更改
为index.ts什么都不做) "name": "server", "description":": { "
express
&qu
浏览 5
提问于2020-12-04
得票数 19
1
回答
表达式/注射器TypeError:无法读取未定义的属性(读取“服务”)
javascript
、
node.js
、
typescript
、
express
、
tsyringe
\
express
\lib\router\route.
js
:144:13) at D:\Projects\
Typescript
\third\node_modules\
express
\
express
\lib\router\ind
浏览 12
提问于2022-06-25
得票数 0
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
TypeScript 3+Express+Node.js
Node.js中的关注点分离
TypeScript Nodejs 项目结构
Node.js中使用express实现简易学生管理系统-增删改查
支配vue框架初阶项目之博客网站-注册功能
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券