This is a demo for this video
This is a react component that will serves and runs a static website only from a .zip
file, by only using some web APIs like
and some other packages:
- We load a
.zip
file from the backend - This
.zip
file contains a static website (.html
,.js
,.css
) files - After loading the
.zip
file, we extract the content - we use Iframes for the
.html
files - we inline the
link
tags (we get the CSS code from the.zip
file and inline them) - we use the Blob API with URL.createObjectURL() to create linkable JS scritps from the
.zip
file
See this demo of this code
https://rowadz.github.io/caskbrewer/
look at the
network
tab and theDOM