egg icon indicating copy to clipboard operation
egg copied to clipboard

使用问题: 请问如何在egg应用下运行脚本,以及如何在脚本中使用app中的service,helper,db等能力

Open cmingxu opened this issue 2 years ago • 1 comments

使用问题: 请问如何在egg应用下运行脚本,以及如何在脚本中使用app中的service,helper,db等能力

cmingxu avatar Jan 09 '24 05:01 cmingxu

不支持这种用法。

要想实现的话,可以试下用 Node 的 repl api,里面去 new 一个 egg,用 egg.start() 这样的单进程,然后就有 app 这个对象可以 expose 给 repl 用了。

atian25 avatar Jan 09 '24 06:01 atian25