cloudflare-internship-2020 / internship-application-fullstack Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
For step 2:
- Request a (random: see #3) variant
Make a fetch request to one of the two URLs, and return it as the response from the script.
I am wondering what type of response should we send back? Should it just be the plain text response from one of the two URLs? (aka HTML source code)
I created an API token using the "Edit Cloudflare Workers" template, but when I entered the API token key, I got this error message:
Validating credentials...
Error: Permission denied (os error 13)
Does anyone know how to solve this issue?
Thanks
I've used NPM to install wrangler but every time I try to use the CLI, I get the following message:
throw `You have not installed ${this.name ? this.name : "this package"}`;
^
You have not installed wrangler
I'm not sure how to fix this. I tried searching for a solution online and in the wrangler docs but couldn't find anything. What should I do?
I didn't fully understand the requirement "3. Distribute requests between variants".
So, I don't have to show different pages to a single user every time(as it's said "when a client makes a request to the Workers script, the script should roughly return each variant"), so I don't have to use cookies for this. Is seems like it's enough just to remember user and count each of 2 urls, or I could use round-robin method, 'cause each of these will give 50% probability. I know that using cookies is extra-credit task "2. Persisting variants
", but I'd like to do both ways :)
Hey guys, when I try to run a simple fetch to that URL, I get this error back (bottom). Is there anyone else experiencing the same issue? I've been doing some research on it, but it's still not clear to me how to fix it
code:
fetch("https://cfw-takehome.developers.workers.dev/api/variants" { /* properties here */ });
error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cfw-takehome.developers.workers.dev/api/variants. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
For this requirement
- Distribute requests between variants
I am wondering what type of actions should we take. Should we simply redirect the page or fetch the content of the variant page and return that as a response?
I am currently working on the extra credit and I realized that with redirecting we probably can't do this task.
For each variant page, there are a number of items on the page that can be customized. Try changing the following values inside of the variant, adding your own text or URLs:
So what is the expected action?
Please can anyone tell me what this error is about and how to resolve it? I am new to Javascript so may this is a basic mistake or error.
My code showing error:
fetch('https://cfw-takehome.developers.workers.dev/api/variants', method="no-cors").then(response => response.json()).then(json => console.log(json))
Error screenshot:
Thanks:)
Extra Credit 2 should be removed or updated with a possible solution because headers are stripped from the request before it gets to the serviceWorker's handler. Cookies can be set but not read from the serviceWorker. localStorage and other storage solutions are not accessible from the serviceWorker either. In conclusion, persistence is not achievable at the moment.
Hello!
So as far as I understand when the user visits the root URL of the app, it should either load variant 1 or variant 2, There is no home view for the given task right?
Can someone tell me how exactly I should upload my code as a zip? the submission link is only allowing me to attach a document.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.