Skip to main content
Latest
File

setup

  1. Install the CLI.

    Note: Deno v1.30.0 or later should be installed.

    deno run -A -q https://deno.land/x/drgn@v0.9.0/installer.js -n darkflare -u darkflare@$version/cli/mod.ts
  2. Add a import map to your deno.json.

    {
      "imports": {
        "darkflare": "https://deno.land/x/darkflare@v7.2.6/mod.ts",
        "darkflare/oauth2": "https://deno.land/x/darkflare@v7.2.6/oauth2/mod.ts",
        "darkflare/realm": "https://deno.land/x/darkflare@v7.2.6/realm/mod.ts"
      }
    }
  3. Add type declarations for your environment variables.

  4. Optionally, you can configure darkflare through a darkflare.yml file.

    To add autocompletion, install the yaml extension and add the below entry to yaml.schemas:

    "https://raw.githubusercontent.com/azurystudio/darkflare/dev/schema.json": "darkflare.yml"
    # name for your app.
    name: 'my-app' # defaults to 'darkflare-*'
    
    # base for your app, e.g. /api.
    base: '/api' # defaults to null
    
    # allowed origin for incoming requests.
    cors: '*' # defaults to null
    
    # cache responses for a given amount of seconds.
    cache: '5m' # defaults to 0
    
    cache: 300