Skip to content

Commit

Permalink
feat: Adding an index.js which only exports safe symbols (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
gja authored Dec 6, 2018
1 parent a5b8b81 commit 6e5323d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { createApp } = require("./app/server");
const { Worker } = require("./app/worker");

module.exports = {
Worker,
createApp
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cloudflare-worker-local",
"version": "1.4.0",
"description": "Run a Cloudflare-compatible Worker Locally",
"main": "start.js",
"main": "index.js",
"scripts": {
"prepublishOnly": "npm install && git diff --quiet && npm test && npx standard-version && git push --follow-tags origin",
"test": "jest",
Expand Down
2 changes: 1 addition & 1 deletion start.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (cluster.isMaster) {
cluster.fork();
});
} else {
const { createApp } = require("./app/server.js");
const { createApp } = require(".");
const port = process.argv[4];
const opts = { upstreamHost: process.argv[3], kvStores: (process.env.KV_NAMESPACES || "").split(",") };
const app = createApp(fs.readFileSync(process.argv[2]), opts);
Expand Down

0 comments on commit 6e5323d

Please sign in to comment.