Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update test worker for testing secrets
  • Loading branch information
Joslin, Brady W (Brady) committed Jun 22, 2020
1 parent 3123fc5 commit aabd478
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/workers-site/index.js
Expand Up @@ -34,6 +34,14 @@ async function handleEvent(event) {
*/
// options.mapRequestToAsset = handlePrefix(/^\/docs/)

// Path to test secrets passed through Wrangler Action. Create SECRET1 and SECRET2 secrets
// in the Action repo to something innocuous like "Hello" and "World!".
if (url.pathname === "/secret") {
let sec1 = (typeof SECRET1 !== 'undefined') ? SECRET1 : ""
let sec2 = (typeof SECRET2 !== 'undefined') ? SECRET2 : ""
return new Response(`${sec1} ${sec2}`)
}

try {
if (DEBUG) {
// customize caching
Expand Down

0 comments on commit aabd478

Please sign in to comment.