Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 16a3828

Browse files
committed
application initialization way has changed
1 parent 1a564e4 commit 16a3828

File tree

9 files changed

+47
-39
lines changed

9 files changed

+47
-39
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,25 @@ This way:
3131
```bash
3232
git clone https://github.com/NikosRig/Mimo-Crawler
3333
cd Mimo-Crawler && npm install
34+
sudo npm link
3435
```
3536

3637
### Getting started
3738

3839

39-
#### Starting with the Mimo Server
40+
#### Start Firefox and the Mimo Server
4041

41-
You must first start the server by executing startMimo.js.
4242
- `--firefox` (optional) Overrides the default firefox binary path.
4343

4444
```bash
45-
node startMimo.js
45+
mimo-start
4646
```
47-
You can also run Mimo on machines with no display hardware and no physical input devices
48-
by using Xvfb. Mimo will be still using a non-headless firefox.
47+
48+
You can also use Mimo on machines with no display hardware and no physical input devices
49+
with the help of Xvfb. Mimo will be continue using a non-headless Firefox.
50+
4951
```bash
50-
xvfb-run node startMimo.js
52+
xvfb-run mimo-start
5153
```
5254

5355
Then you are ready to use the Mimo API by including mimoClient.js

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "mimo",
3-
"version": "1.0.0",
4-
"description": "Mimo browser based crawler",
3+
"version": "1.0.1",
4+
"description": "Mimo is a state of the art web crawler that uses non-headless Firefox and js injection to crawl webpages.",
55
"author": "Nikos Rigas",
6-
"license": "ISC",
6+
"license": "GPL-3.0",
7+
"bin": {
8+
"mimo-start": "./src/bin/initMimo.js"
9+
},
710
"dependencies": {
811
"awilix": "^4.2.6",
912
"child_process": "^1.0.2",
File renamed without changes.

startMimo.js renamed to src/app/Container/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
const container = require(__dirname + '/src/app/container');
2+
const container = require('./container');
33

44
container.resolve('processArgv');
55

src/app/Container/container.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
const awilix = require('awilix');
3+
4+
const container = awilix.createContainer({
5+
injectionMode: awilix.InjectionMode.PROXY
6+
});
7+
8+
9+
container.register({
10+
11+
filesystem: awilix.asValue(require('fs')),
12+
argv: awilix.asValue(require('minimist')(process.argv.slice(2))),
13+
web_ext: awilix.asValue(require('web-ext')),
14+
appConfig: awilix.asValue(require('../Config/appConfig')),
15+
processArgv: awilix.asFunction(require('../Utils/argvProcessor')),
16+
logger: awilix.asValue(require('../../Logging/Logger')),
17+
websocketServer: awilix.asClass(require('../Server/websocketServer')).singleton(),
18+
routingService: awilix.asClass(require('../Services/RoutingService')).singleton(),
19+
routes: awilix.asFunction(require('../Routing/Routes')).singleton(),
20+
browserService: awilix.asClass(require('../Services/BrowserService')).singleton(),
21+
messageService: awilix.asClass(require('../Services/MessageService')).singleton(),
22+
messageController: awilix.asClass(require('../Controllers/MessageController')),
23+
24+
});
25+
26+
27+
module.exports = container;
28+
File renamed without changes.

src/app/container.js

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/bin/initMimo.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
const application = require(__dirname + '/../app/Container/application.js');

0 commit comments

Comments
 (0)