
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@harperdb/http-router
Advanced tools
A HarperDB Component for routing requests using the Edgio/Layer0 router API
A HarperDB Component for routing requests to other components that is inspired by the Edgio router API: https://docs.edg.io/applications/v4/routing.
Go into the HarperDB application you would building and install this package and add it to the config.yaml file:
npm install @harperdb/http-router
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
})
All configuration options are optional
port: numberSpecify a port for the caching server. Defaults to 9926.
files: StringUsed to load the necessary JS files.
Example usage:
'@harperdb/http-router':
package: '@harperdb/http-router'
files: '*.*js'
clearRestIntervalCount: 1000
clearRestIntervalMs: 10
scheduledFullCacheClearTime: 10.33
additionalCacheDatabaseGroups:
- 'api'
By default, the cache will use a database named cache to store cached records. You can specify additional database groups to use for caching via the additionalCacheDatabaseGroups configuration option in the config.yaml file.
Each additional database group will create a new database to store cached records. The database group name can optionally be passed as the cacheGroup paramater as part of the edge caching configuration within the request actions.
i.e.
cache({
edge: {
maxAgeSeconds: 10000,
staleWhileRevalidateSeconds: 3600,
cacheGroup: 'api'
}
})
Cache can be invalidated via a POST request to /invalidate
This will invalidate records from the default cache database. To invalidate records from an additional cache database, use the x-cache-group request header to specify the database group name.
i.e.
POST /invalidate
HEADER: 'x-cache-group: api'
FAQs
A HarperDB Component for routing requests using the Edgio/Layer0 router API
We found that @harperdb/http-router demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?

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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.