Skip to content

Commit

Permalink
Merge pull request #281 from hyper63/twilson63/bug-core-error-with-sp…
Browse files Browse the repository at this point in the history
…ider-280

Twilson63/bug core error with spider 280
  • Loading branch information
twilson63 committed Jul 27, 2021
2 parents dc66071 + a0540a8 commit e54d3b9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 4 additions & 0 deletions images/crawler/deps.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { default as core } from '../../packages/core/mod.js'
export { default as opine } from '../../packages/app-opine/mod.js'
//export { spider } from 'https://x.nest.land/[email protected]/mod.js'
export { default as spider } from 'https://raw.githubusercontent.com/hyper63/hyper-adapter-spider/main/mod.js'
12 changes: 12 additions & 0 deletions images/crawler/hyper.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { opine, spider } from './deps.js'

const spiderUrl = Deno.env.get('SPIDER_URL')

export default {
app: opine,
adapters: [
{ port: 'crawler', plugins: [spider({
links: spiderUrl, content: spiderUrl
})]}
]
}
4 changes: 4 additions & 0 deletions images/crawler/mod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import config from './hyper.config.js'
import { core } from './deps.js'

await core(config)
2 changes: 2 additions & 0 deletions packages/core/lib/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import storageCore from "./storage/mod.js";
import searchCore from "./search/mod.js";
import hooksCore from "./hooks/mod.js";
import queueCore from "./queue/mod.js";
import crawlerCore from "./crawler/mod.js";

/**
* main core module
Expand All @@ -19,6 +20,7 @@ export default function (services) {
storage: services.storage ? storageCore(services) : null,
search: services.search ? searchCore(services) : null,
queue: services.queue ? queueCore(services) : null,
crawler: services.crawler ? crawlerCore(services) : null,
hooks: hooksCore(services),
events: services.events,
middleware: services.middleware,
Expand Down
2 changes: 0 additions & 2 deletions packages/core/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export default async function main(config) {
//load methods can return promises so entire plugin svc returns a promise -tnw
const adapters = await initAdapters(prop("adapters", config));

// TODO: validate config
const services = compose(
// add eventMgr to services
wrapCore,
Expand All @@ -30,7 +29,6 @@ export default async function main(config) {
)(adapters);

const app = config.app(services);

// return app
return app;
}
Expand Down

0 comments on commit e54d3b9

Please sign in to comment.