Last active
April 15, 2024 09:14
-
-
Save srenatus/b1f64c2282e2fb92040c011df4964de9 to your computer and use it in GitHub Desktop.
example: use opa-typescript from deno -- run via `deno task dev`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"tasks": { | |
"dev": "deno run --allow-net --watch main.ts" | |
}, | |
"imports": { | |
"opa": "https://esm.sh/@styra/[email protected]" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { OPAClient } from "opa"; | |
async function run() { | |
const opa = new OPAClient(); | |
const result = await opa.authorize("system", { | |
what: "ever", | |
}); | |
console.debug(result); | |
} | |
// Learn more at https://deno.land/manual/examples/module_metadata#concepts | |
if (import.meta.main) { | |
run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment