JSON.stringify(req, Object.getOwnPropertyNames(Object.getPrototypeOf(req)), '\t')Object.keys() or console.log()) and they're also on the prototype (so not picked up by Object.getOwnPropertyNames() which looks at the instance) - but there are ways to print out what's on them.console.log a Web API type in Node/Browsers/etc
^1.0.0 (note the ^), then any version compatible with 1.0.0 could be installedfunctions/getFeed.js file are currently@cloudflare/next-on-pages, the functions directory will not work as we generate our own _worker.js instead, and, as such, you should use Next.js Edge API routes instead.
crypto.getHashes has not been implemented yet when i try to deployObject.keys()console.log()Object.getOwnPropertyNames()^1.0.0^1.0.0functions/getFeed.js@cloudflare/next-on-pages_worker.jscrypto.getHashes has not been implemented yetimport { OpenAI } from 'langchain/llms/openai';
export default defineEventHandler(async e => {
const model = new OpenAI(); //OPENAI_API_KEY set in env
});console.log({
url: req.url,
method: req.method,
...
});for (const property in req) {
console.log(`${property}: ${req[property]}`);
}<html>
<head>
<script src="https://unpkg.com/htmx.org@1.9.4"></script>
<script src="https://unpkg.com/hyperscript.org@0.9.11"></script>
</head>
<script>
function loadIndex() {
console.log('test');
htmx.ajax('GET', '/getFeed', {target: "#swap", headers: {
}})
}
</script>
<body onload="loadIndex()">
...
</body>
</html>export const onRequestGet = () => {
return new Response("Hello, world!")
}