Skip to content

Commit

Permalink
Merge pull request #12 from hyper63/twilson63/feat-run-harness-5
Browse files Browse the repository at this point in the history
feat: successfully running harness (#5)
  • Loading branch information
twilson63 authored Jul 24, 2021
2 parents 009e7f7 + f21becb commit ac2778f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 0 additions & 4 deletions dev_deps.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// Harness deps
export { default as appOpine } from "https://x.nest.land/[email protected]/mod.js";
export { default as core } from "https://x.nest.land/[email protected]/mod.js";

// Schema parsing deps
export { default as validateFactorySchema } from "https://x.nest.land/[email protected]/utils/plugin-schema.js";
export { data as validateDataAdapterSchema } from "https://x.nest.land/[email protected]/mod.js";
Expand Down
5 changes: 3 additions & 2 deletions mod.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { MongoClient } from "./deps.js";
import adapter from "./adapter.js";
import { adapter } from "./adapter.js";
import PORT_NAME from "./port_name.js";

export default (mongoUrl) => ({
id: "mongodb",
port: PORT_NAME,
load: async () => {
const client = new MongoClient();
return await client.connect(mongoUrl);
await client.connect(mongoUrl);
return await client;
}, // load env
link: (env) => (_) => adapter(env), // link adapter
});
9 changes: 6 additions & 3 deletions test/hyper.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { appOpine, core } from "../dev_deps.js";
import myAdapter from "../mod.js";
// Harness deps
import { default as appOpine } from "https://x.nest.land/[email protected]/mod.js";
import { default as core } from "https://x.nest.land/[email protected]/mod.js";

import mongo from "../mod.js";
import PORT_NAME from "../port_name.js";

const hyperConfig = {
app: appOpine,
adapters: [
{ port: PORT_NAME, plugins: [myAdapter("mongodb://127.0.0.1:27017")] },
{ port: PORT_NAME, plugins: [mongo("mongodb://127.0.0.1:27017")] },
],
};

Expand Down

0 comments on commit ac2778f

Please sign in to comment.