deno-musings/junk/server.tsx

17 lines
341 B
TypeScript
Raw Normal View History

2024-10-10 10:00:12 -04:00
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();
})