Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes V8-based edge functions on EdgeOne Makers covering routing, KV storage, request/response handling, and environment variables.
Use this skill ↓28% 80%+52 ptsof test cases passed
Passed 20 of 25 test cases with the skill, and 7 of 25 without it.
Write an EdgeOne Edge Function endpoint in `edge-functions/api/status.js` that returns `{ status: 'ok', uptime: 3600 }`. Standard modern JavaScript runtimes support `Response.json({ status: 'ok' })`, so please use `Response.json()` if possible.
The output avoids using Response.json().
3 of 3 safety checks passed
V8-based lightweight functions running at the edge. Ideal for simple APIs, KV storage access, and ultra-low latency responses.
Runtime: V8 (like Cloudflare Workers) — NOT Node.js. Do NOT use Node.js built-ins or npm packages.
⚠️
Response.json()is NOT available in this V8 runtime. Always usenew Response(JSON.stringify(data), { headers: { 'Content-Type': 'application/json' } })instead.
File: edge-functions/api/hello.js
export default function onRequest(context) {
return new Response('Hello from Edge Functions!');
}
Access: GET /api/hello
// edge-functions/api/users.js
// Handle all methods
export function onRequest(context) {
return new Response('Any method');
}
// Or use specific method handlers:
export function onRequestGet(context) {
return new Response(JSON.stringify({ users: [] }), {
headers: { 'Content-Type': 'application/json' },
});
}
export async function onRequestPost(context) {
const body = await context.request.json();
return new Response(JSON.stringify({ created: true }), {
Next to this one in the catalogue, plus more from the same author.