vite/playground/json/index.ssr.html

24 lines
599 B
HTML

<div class="fetch-json-module">
json-module:
<pre></pre>
<code></code>
</div>
<div class="fetch-json-fs">
json-fs:
<pre></pre>
<code></code>
</div>
<script type="module">
const startModule = Date.now()
text('.fetch-json-module pre', await (await fetch('/json-module')).text())
text('.fetch-json-module code', Date.now() - startModule)
const startFs = Date.now()
text('.fetch-json-fs pre', await (await fetch('/json-fs')).text())
text('.fetch-json-fs code', Date.now() - startFs)
function text(sel, text) {
document.querySelector(sel).textContent = text
}
</script>