Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adding an index.js which only exports safe symbols #19

Merged
merged 1 commit into from
Dec 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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