This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
async fetch(request) { | |
// Get the URL | |
const url = new URL(request.url); | |
// url.pathname will be our pathname to use in the HTML doc | |
// Change this to whatever your Substack subdomain is: | |
const subdomain = "12challenges"; | |
const html = `<!DOCTYPE html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change this to suit your case! | |
// IMPORTANT: make sure there is no '/' at the end of either URL | |
const config = { | |
originPage: "view.flodesk.com/emails", | |
} | |
// Function that processes requests to the URL the worker is at | |
async function handleRequest(request) { | |
// Grab the request URL's pathname, we'll use it later | |
const url = new URL(request.url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
const originDomainAndPath = "view.flodesk.com/emails"; | |
const superMailerDomain = "mailer.super.so"; | |
async function createObserver() { | |
// Start observing the document | |
observeDoc(); | |
// Observer function | |
function observeDoc() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Config for our domain (where we want the Roam blog to live) | |
// and the start page (where we want our readers to land) | |
// Change these to suit your case! | |
// IMPORTANT: don't have '/' at the end of either domain or startPage | |
const config = { | |
domain: "roam.cloak.ist", | |
startPage: "/#/app/nudge/page/RI01qJl4P", | |
} | |
// Function that processes requests to the domain the worker is at |