0.3.0 • Published 6 months ago

@harperdb/http-router v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

@harperdb/http-router

A HarperDB Component for routing requests to other components that is inspired by the Edgio router API: https://docs.edg.io/applications/v4/routing.

NPM Version

Installation

Go into the HarperDB application you would building and install this package and add it to the config.yaml file:

  1. Install:
npm install @harperdb/http-router
  1. Add to config.yaml:
'@harperdb/http-router':
  package: '@harperdb/http-router' # this can include a @version number if desired
  files: '*.*js' # Load js files so it can find the router.js file and config
# The router comes before the other main framework adapter in the pipeline
'@harperdb/nextjs':
  package: '@harperdb/nextjs'
  files: '/*'
  prebuilt: true

And then you can build a router.js file in the root of your application that looks like this:

const { Router, or, nextRoutes } = require('@harperdb/http-router');
module.exports = new Router().get('/some-path', ({ cache, proxy }) => {
	// handle the request here
})

Options

All configuration options are optional

port: number

Specify a port for the caching server. Defaults to 9926.

files: String

Used to load the necessary JS files.

0.3.0

6 months ago

0.2.10

9 months ago

0.2.9

10 months ago

0.2.8

10 months ago

0.2.7

10 months ago

0.2.6

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.19

11 months ago

0.1.18

11 months ago

0.1.17

11 months ago

0.1.16

11 months ago

0.1.15

11 months ago

0.1.14

11 months ago

0.1.13

11 months ago

0.1.12

12 months ago

0.1.11

12 months ago

0.1.10

12 months ago

0.1.9

12 months ago

0.1.8

12 months ago

0.1.7

12 months ago

0.1.6

12 months ago

0.1.5

12 months ago

0.1.4

12 months ago

0.1.3

12 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago