eggjs / eggjs/egg

SingleMode

Open
#4,308 7 comments 1 reaction 0 assignees View on GitHub
Inactive
Dominant language
TypeScript
Stars
19k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

I asked this question before
https://github.com/eggjs/egg/issues/3262
https://github.com/eggjs/egg/issues/4183

It is too complicated for me!!

How can I run eggjs in single mode and create an anonymous context?
I want to **Run eggjs as library**

>I create a complex RESTful web service by eggjs , it have many services and plugins
I want to create workers (some js scripts) for my messaging queue (rabbitmq) and I want to reuse services and plugins , so I need to access to ctx object

```js
const runWorker = ()=>{
// some code here

//here I need eggjs service
const configs = {
baseDir : 'mainAppDir'
};

const egg= //Create a single mode eggjs instance
const ctx = egg.createAnonymousContext();

}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.