@harperdb/astro v0.0.2
@harperdb/astro
A Harper Component for running Astro applications.
Getting Started
Add the
@astrojs/nodeintegration to the Astro application, and set the mode to'middleware'.- For example:
import { defineConfig } from 'astro/config'; import node from '@astrojs/node'; export default defineConfig({ adapter: node({ mode: 'middleware', }), });Create a
config.yamlin the root of the Astro app containing:'@harperdb/astro': package: '@harperdb/astro' files: './'- Run the application using Harper. For more information reference the Harper Component documentation.
Options
All configuration options are optional
buildCommand: string
Specify a custom build command. Defaults to astro build.
Note: the extension will skip building if the
prebuiltoption is set totrue.
port: number
Specify a port for the Astro handlers. Defaults to the Harper default port (generally 9926).
prebuilt: boolean
When enabled, the extension will look for a dist directory in the root of the component, and skip executing the buildCommand if detected. Defaults to false.
securePort: number
Specify a secure port for the Astro handlers. Defaults to the Harper default secure port.
Example
This repo contains an example Astro app that is already configured to work with Harper.
- Clone the repo, and navigate to the example directory
cd example - Install dependencies
npm install - Run the example with Harper
harperdb run .