@flink-app/generic-request-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.7.0-alpha.1 • Public • Published

Flink API Docs

A FLINK plugin that makes it possible to overide the default request handler and handle a request by your own code.

Usage

Install plugin to your flink app project:

npm i -S @flink-app/generic-request-plugin

Add and configure plugin in your app startup (probable the index.ts in root project):

import { genericRequestPlugin, HttpMethod} from "@flink-app/generic-request-plugin";

function start() {
  new FlinkApp<AppContext>({
    name: "My app",
    plugins: [
        // Register plugin
        genericRequestPlugin({
          "path" : "/url",
          "method" : HttpMethod.get,
          "handler" : (req, res, app) => {
            res.setHeader('Content-type','text/html');
            res.end("Hello world!")
          }
        })
    ],
  }).start();
}

Readme

Keywords

none

Package Sidebar

Install

npm i @flink-app/generic-request-plugin

Weekly Downloads

3

Version

0.7.0-alpha.1

License

MIT

Unpacked Size

5.92 kB

Total Files

7

Last publish

Collaborators

  • joelso
  • jenkins-frost
  • johanfrost