How to use the webiny-api.api.configure function in webiny-api

To help you get started, we’ve selected a few webiny-api 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 webiny / webiny-js / examples / cloud-api / src / app / middleware.js View on Github external
export default async () => {
    // Configure default storage
    const localDriver = new LocalDriver({
        directory: __dirname + "/../../storage",
        createDatePrefix: false,
        publicUrl: "http://localhost:9000/storage/"
    });

    api.configure({
        database: { connection },
        entity: {
            // Instantiate driver with DB connection
            driver: new MySQLDriver({ connection }),
            // Configure entity attributes
            attributes: ({
                /*                passwordAttribute,
                identityAttribute,
                bufferAttribute,*/
                fileAttributes,
                imageAttributes
            }) => {
                /*                identityAttribute();
                passwordAttribute();
                bufferAttribute();*/
                fileAttributes({
github webiny / webiny-js / examples / api / src / install.js View on Github external
require("babel-register");
const config = require("./configs");
const { api } = require("webiny-api");
const { default: myApp } = require("./myApp");
const { app: cmsApp } = require("webiny-api-cms");

api.configure(config())
    .use(myApp())
    .use(cmsApp())
    .install();
github webiny / webiny-js / packages / demo-api / src / api.js View on Github external
import config from "./configs";
import { api } from "webiny-api";
import { app as cmsApp } from "webiny-api-cms";
import myApp from "./myApp";

api.configure(config())
    .use(cmsApp())
    .use(myApp());

export default api;