Skip to content

Instantly share code, notes, and snippets.

View ThatBlockyPenguin's full-sized avatar

BlockyPenguin ThatBlockyPenguin

View GitHub Profile
@ThatBlockyPenguin
ThatBlockyPenguin / serve.ts
Last active January 22, 2024 18:39
Basic Deno Server
// deno install --allow-read --allow-net https://gist.githubusercontent.com/ThatBlockyPenguin/fc8d06a1f8a1a6493b9fe6159d20ed0f/raw/serve.ts
import { existsSync } from 'https://deno.land/std/fs/mod.ts';
import { join } from 'https://deno.land/std/path/mod.ts';
const serveDir = join('./', Deno.args[0]);
const dirFound = existsSync(serveDir);
if (!dirFound)
throw `Directory "${serveDir}" not found!`;