How to use slicknode-runtime - 1 common examples

To help you get started, we’ve selected a few slicknode-runtime 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 slicknode / slicknode / src / commands / runtime / start.ts View on Github external
public async run() {
    const input = this.parse(RuntimeStartCommand);
    const port = input.flags.port || DEFAULT_PORT;

    // Configure Slicknode runtime
    const runtime = new SlicknodeRuntime({
      ...(input.flags.secret ? {secret: input.flags.secret} : {}),
    });

    // Register modules in runtime
    const projectRoot = this.getProjectRoot();
    const modules = await getModuleList(projectRoot);
    modules
      .filter((module) => module.config.runtime)
      .forEach((module) => {
        runtime.register(module.config.module.id, module.path);
      });

    // Create express app
    const app = express.default();
    app.use(bodyParser.raw({
      type: 'application/json',

slicknode-runtime

**IMPORTANT:** This library should be considered an implementation detail and should not be used directly. Please consult the [Slicknode documentation](https://slicknode.com/docs/) on how to create and write runtime handlers.

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular slicknode-runtime functions

Similar packages