Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

@proc/runtime

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@proc/runtime

An koa web-app runtime for @proc/context

latest
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

Koa web app runtime for @proc/context

Simplies starting a web app server. Uses dotenv for configuration bootstrapping.

Usage

import { bootstrap, getRequestContext } from "@proc/runtime";

// create middlewares in order, like you would call `app.use()` in koa
const middlewares = [
  (ktx, next) => {
    const ctx = getRequestContext(ktx);
    ctx.log.info("log something?");
    ktx.body = `<h1>Served with context id: ${ctx.id}</h1>`;
  }
];

const app = bootstrap();
app.use(...middlewares);
app.run().catch(err => {
  app.ctx.log.error(err, "unexpected error!");
});

FAQs

Package last updated on 08 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts