Built-In Components
Harper provides extended features using built-in components. They do not need to be installed with a package manager, and simply must be specified in a config to run. These are used throughout many Harper docs, guides, and examples. Unlike external components which have their own semantic versions, built-in components follow Harper's semantic version.
fastifyRoutes
Specify custom endpoints using Fastify.
This component is a Resource Extension and can be configured with the files
, path
, and root
configuration options.
Complete documentation for this feature is available here: Define Fastify Routes
fastifyRoutes:
files: './routes/*.js'
graphql
GraphQL querying provides functionality for mapping GraphQL querying functionality to exported resources, and is based on the GraphQL Over HTTP / GraphQL specifications (it is designed to intuitively map queries to Harper resources, but does not implement the full specification of resolvers, subscribers, and mutations).
Enables GraphQL querying via a /graphql
endpoint loosely implementing the GraphQL Over HTTP specification.
Complete documentation for this feature is available here: GraphQL
graphql: true
graphqlSchema
Specify schemas for Harper tables and resources via GraphQL schema syntax.
This component is a Resource Extension and can be configured with the files
, path
, and root
configuration options.
Complete documentation for this feature is available here: Defining Schemas
graphqlSchema:
files: './schemas.graphql'
jsResource
Specify custom, JavaScript based Harper resources.
Refer to the Application Custom Functionality with JavaScript guide, or Resource Class reference documentation for more information on custom resources.
This component is a Resource Extension and can be configured with the files
, path
, and root
configuration options.
jsResource:
files: './resource.js'
rest
Enable automatic REST endpoint generation for exported resources with this component.
Complete documentation for this feature is available here: REST
rest: true
This component contains additional options:
To enable Last-Modified
header support:
rest:
lastModified: true
To disable automatic WebSocket support:
rest:
webSocket: false
roles
Specify roles for Harper tables and resources.
This component is a Resource Extension and can be configured with the files
, path
, and root
configuration options.
Complete documentation for this feature is available here: Defining Roles
roles:
files: './roles.yaml'
static
Specify which files to server statically from the Harper HTTP endpoint. Built using the send and serve-static modules.
This component is a Resource Extension and can be configured with the files
, path
, and root
configuration options.
static:
files: './web/*'
Last updated