0.3.0 • Published 9 months ago

@harperdb/http-router v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 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

9 months ago

0.2.10

12 months ago

0.2.9

12 months ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago