Skip to content

extend/application.js空导出,导致接口返回404 #5316

Open
@qinfeng0214

Description

@qinfeng0214

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

您好,我正在学习egg。如果我的application.js代码,不注释这些代码,接口访问就会返回404
// app/extend/application.js
// 扩展 application 对象,可以添加应用级别的中间件、配置日志等。
//不注释下面的代码,就会导致我的接口返回404
module.exports = {
properties: {
// 应用级别的属性
},
// 应用生命周期方法
async beforeStart() {
// 应用启动前执行的逻辑
},
async didLoad() {
// 应用加载完成后执行的逻辑
}
// 其他生命周期方法...
}

可复现问题的仓库地址(Reproduction Repo)

null

Node 版本号:

v18.16.0

Eggjs 版本号:

egg3

相关插件名称与版本号(PlugIn and Name):

null

操作平台与版本号(Platform and Version):

mac

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions