mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-25 03:14:46 +01:00
update test worker for testing secrets
This commit is contained in:
parent
3123fc538b
commit
aabd478947
1 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,14 @@ async function handleEvent(event) {
|
||||||
*/
|
*/
|
||||||
// options.mapRequestToAsset = handlePrefix(/^\/docs/)
|
// 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 {
|
try {
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
// customize caching
|
// customize caching
|
||||||
|
|
Loading…
Reference in a new issue