Skip to content

Commit 6e5323d

Browse files
authored
feat: Adding an index.js which only exports safe symbols (#19)
1 parent a5b8b81 commit 6e5323d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { createApp } = require("./app/server");
2+
const { Worker } = require("./app/worker");
3+
4+
module.exports = {
5+
Worker,
6+
createApp
7+
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cloudflare-worker-local",
33
"version": "1.4.0",
44
"description": "Run a Cloudflare-compatible Worker Locally",
5-
"main": "start.js",
5+
"main": "index.js",
66
"scripts": {
77
"prepublishOnly": "npm install && git diff --quiet && npm test && npx standard-version && git push --follow-tags origin",
88
"test": "jest",

start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (cluster.isMaster) {
2323
cluster.fork();
2424
});
2525
} else {
26-
const { createApp } = require("./app/server.js");
26+
const { createApp } = require(".");
2727
const port = process.argv[4];
2828
const opts = { upstreamHost: process.argv[3], kvStores: (process.env.KV_NAMESPACES || "").split(",") };
2929
const app = createApp(fs.readFileSync(process.argv[2]), opts);

0 commit comments

Comments
 (0)