Skip to content

Commit

Permalink
Make deno deploy function from reader
Browse files Browse the repository at this point in the history
  • Loading branch information
rarous committed Dec 12, 2022
1 parent e6ddb85 commit 751392b
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions reader/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { serve } from "https://deno.land/std@0.155.0/http/server.ts";
import { parse } from "https://deno.land/x/xml/mod.ts";

const text = await Deno.readTextFile("../XONE K2 - 4 decks (Live FX).xml");
const xml = parse(text);
/**
* @param {Request} req
* @return {Promise<Response>}
*/
export async function handler(req) {
const text = await req.text();
const xml = parse(text);
return Response.json(xml);
}

console.log(JSON.stringify(xml, null, 2));
serve(handler);

0 comments on commit 751392b

Please sign in to comment.