How to use the @paperbits/core/core.module.CoreModule function in @paperbits/core

To help you get started, we’ve selected a few @paperbits/core 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 Azure / api-management-developer-portal / src / startup.publish.ts View on Github external
import { ProseMirrorModule } from "@paperbits/prosemirror/prosemirror.module";
import { StaticSettingsProvider } from "./components/staticSettingsProvider";
import { FileSystemBlobStorage } from "./components/filesystemBlobStorage";
import { ApimPublishModule } from "./apim.publish.module";

/* Reading settings from configuration file */
const configFile = path.resolve(__dirname, "./config.json");
const configuration = JSON.parse(fs.readFileSync(configFile, "utf8").toString());
const settingsProvider = new StaticSettingsProvider(configuration);

/* Storage where the website get published */
const outputBlobStorage = new FileSystemBlobStorage("./dist/website");

/* Initializing dependency injection container */
const injector = new InversifyInjector();
injector.bindModule(new CoreModule());
injector.bindModule(new CorePublishModule());
injector.bindModule(new StyleModule());
injector.bindModule(new ProseMirrorModule());
injector.bindModule(new ApimPublishModule());
injector.bindInstance("settingsProvider", settingsProvider);
injector.bindInstance("outputBlobStorage", outputBlobStorage);
injector.resolve("autostart");

/* Allowing self-signed certificates for HTTP requests */
process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = "0";

/* Bulding dependency injection container */
const publisher = injector.resolve("sitePublisher");

/* Running actual publishing */
publisher.publish()
github Azure / api-management-developer-portal / examples / function / publish / index.ts View on Github external
managementApiAccessToken: configuration.managementApiAccessToken,
        blobStorageContainer: configuration.outputBlobStorageContainer,
        blobStorageConnectionString: configuration.outputBlobStorageConnectionString,
        environment: "publishing"
    });

    const outputSettingsProvider = new StaticSettingsProvider({
        blobStorageContainer: configuration.outputBlobStorageContainer,
        blobStorageConnectionString: configuration.outputBlobStorageConnectionString
    });

    /* Storage where the website get published */
    const outputBlobStorage = new AzureBlobStorage(outputSettingsProvider);

    const injector = new InversifyInjector();
    injector.bindModule(new CoreModule());
    injector.bindModule(new CorePublishModule());
    injector.bindModule(new StyleModule());
    injector.bindModule(new ProseMirrorModule());
    injector.bindModule(new ApimPublishModule());
    injector.bindInstance("settingsProvider", settingsProvider);
    injector.bindInstance("outputBlobStorage", outputBlobStorage);
    injector.resolve("autostart");

    const publisher = injector.resolve("sitePublisher");
    await publisher.publish();
}