alecbar / cloudflare2020summerinternship

Cloudflare 2020 Summer Internship Full-Stack Developer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cloudflare Workers Internship Application: Full-Stack

This is my submission for the Cloudflare 2020 Summer Internship.

What is it?

This application is hosted on Cloudflare Workers and randomly sends user one of two pages, A/B testing style.

How does it work?

  • Uses fetch() to get the page variants from https://cfw-takehome.developers.workers.dev/api/variants
  • Randomly selects which link variant to use and uses fetch() again to get the HTML page source
  • Serves the HTML page in the response

Extra features

  • Checks for cookie to determine if user has visited before in order to serve the same page, if not serves random page and sends back cookie for future use
  • Uses HTMLRewriter to modify HTML page source before sending
  • Hosted on custom domain alecbarnard.io through Cloudflare

Try it

Try it out for yourself at internship.alecbarnard.workers.dev or alecbarnard.io.

Use Chrome DevTools to inspect and clear cookies to see if you get a different page version.

More information

View the original prompt and instructions here.

About

Cloudflare 2020 Summer Internship Full-Stack Developer

License:Apache License 2.0


Languages

Language:JavaScript 100.0%