Skip to content
Open
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
1 change: 1 addition & 0 deletions dist/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions local_testing/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Local testing

1. Run `npm run build`
2. Add any additional scripts or css files to the head of **`test.html`** .
3. View `./<ExampleApp>/local_testing/test.html` in your browser to allow you to test offline and without using the [App Creator](https://www.cloudflare.com/apps/developer/app-creator)

Note The default values in **`install.json`** will be used.
12 changes: 12 additions & 0 deletions local_testing/test.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html>
<head>
<script src="../dist/bundle.js"></script>
<!-- Add any other source files you wish to test locally here -->
<link rel="stylesheet" href="../source/app.css">
<script src="../source/app.js"></script>
</head>
<body>
<p>Example Body Text </p>
</body>
</html>
18 changes: 18 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var INSTALL_JSON = require('./install.json');
window.CloudflareApps = {}

// Scripts to enable local testing with CloudflareApps' methods
// For more details see https://www.cloudflare.com/apps/developer/docs/create-an-app/environment
require("./node_modules/@cloudflare-apps/environment/lib/create.js")
require("./node_modules/@cloudflare-apps/environment/lib/body.js")
require("./node_modules/@cloudflare-apps/environment/lib/notifier.js")
require("./node_modules/@cloudflare-apps/environment/lib/restrict.js")
require("./node_modules/@cloudflare-apps/environment/lib/selector.js")

// Assign INSTALL_OPTIONS to the default options in install.json
window.INSTALL = window.CloudflareApps
window.INSTALL_PROPERTIES = INSTALL_JSON.options.properties
var installDefaultArr = Object.keys(INSTALL_PROPERTIES).map((property) => {
let obj = {}; obj[property] = INSTALL_PROPERTIES[property].default; return obj;
})
window.INSTALL_OPTIONS = installDefaultArr.reduce((el, acum) => Object.assign(acum, el))
Loading