How to use edgegrid - 2 common examples

To help you get started, we’ve selected a few edgegrid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wyvern8 / akamai-nginx / start.js View on Github external
// to run locally against your papi json, run 'npm run configure'
        // and set env var AKA_PAPI_JSON_FILE to your json, eg. 'papiJson/your.property-v1.papi.json'
        // lua output file
        let localPapiJson = process.env.AKA_PAPI_JSON_FILE ? process.env.AKA_PAPI_JSON_FILE : 'sample.papi.json';

        setLocalConfig(
            localPapiJson,
            luaOutputFile
        );

    } else {
        // edgerc section name
        let edgercSection = process.env.AKA_EDGERC_SECTION ? process.env.AKA_EDGERC_SECTION : 'default';

        // assumes you have configured edgegrid
        const edgegrid = new EdgeGrid({
            path: process.env.AKA_EDGERC,
            section: edgercSection
        });

        // assumes you have set env vars as output of 'npm run configure' or another method
        setApiConfig(
            edgegrid,
            process.env.AKA_CONTRACT_ID,
            process.env.AKA_GROUP_ID,
            process.env.AKA_PROPERTY_ID,
            process.env.AKA_PROPERTY_VERSION,
            luaOutputFile
        );
    }

    // map old to new values in generated lua based on local json (gitignored)
github wyvern8 / akamai-nginx / configure.js View on Github external
(async function() {

    // load .env vars
    dotenv.config();

    let papiResponses = new Map();

    const edgegrid = new EdgeGrid({
        path: process.env.AKA_EDGERC,
        section: 'default'
    });

    let contractId = await papiChoice(
        'Select Akamai contract:',
        '/papi/v1/contracts',
        'contracts', 'contractId', 'contractTypeName'
    );

    let groupId = await papiChoice(
        'Select Akamai property group:',
        '/papi/v1/groups/?contractId=' + contractId,
        'groups', 'groupId', 'groupName'
    );

edgegrid

Authentication handler for the Akamai OPEN EdgeGrid Authentication scheme in Node.js

Apache-2.0
Latest version published 5 years ago

Package Health Score

45 / 100
Full package analysis

Popular edgegrid functions