Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// render WebcamPage as a client side react component with fetch handler response object
const script = `
import WebcamPage from 'https://esm.sh/gh/fal-ai/fal-js@9cc7cf5456/apps/demo-nextjs-app-router/app/camera-turbo/page.tsx';
import React from 'https://esm.sh/react@17.0.2?dev';
import { render } from 'https://esm.sh/react-dom@17.0.2?dev';
render(React.createElement(WebcamPage), document.getElementById('root'));
`;
export default (request: Request) =>
new Response(
`<script type="module">${script}</script><body><div id="root"></div></body>`,
{ headers: { "content-type": "text/html" } },
);
stevekrouse-pinkpig.web.val.run
March 25, 2024