ls-deno/routes/api/random-uuid.ts

11 lines
258 B
TypeScript
Raw Permalink Normal View History

2022-09-27 14:41:17 -05:00
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
GET(_: Request) {
const uuid = crypto.randomUUID();
return new Response(JSON.stringify(uuid), {
headers: { "Content-Type": "application/json" },
});
},
};