deno-musings/junk/server.tsx
2024-10-10 10:01:12 -04:00

17 lines
341 B
TypeScript

const Extension =(inPath:string)=>
{
const posSlash = inPath.lastIndexOf("/");
const posDot = inPath.lastIndexOf(".");
return posDot > posSlash ? inPath.substring(posDot+1).toLowerCase() : false;
};
Deno.serve((r)=>{
const url = new URL(r.url);
const ext = Extension(url.pathname);
return new Response();
})