docs(pockethost): Added serve command details

This commit is contained in:
Ben Allfree 2024-06-29 17:21:29 -07:00
parent 0e4bf43942
commit f79b067574
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
'pockethost': patch
---
Added serve command details

View File

@ -16,6 +16,7 @@ Extend PocketHost with its Plugin ecosystem. Start with the bare-bones dev serve
- [Quickstart](#quickstart) - [Quickstart](#quickstart)
- [Introduction](#introduction) - [Introduction](#introduction)
- [The magic `serve` command](#the-magic-serve-command)
- [Configuration](#configuration) - [Configuration](#configuration)
- [Plugins Directory](#plugins-directory) - [Plugins Directory](#plugins-directory)
- [Writing Plugins](#writing-plugins) - [Writing Plugins](#writing-plugins)
@ -39,6 +40,32 @@ Use PocketHost for development or production purposes.
PocketHost can be easily extended using its thoughtful plugin architecture. By choosing additional plugins, PocketHost's features can be extended according to your exact needs. You can even write your own plugins. PocketHost can be easily extended using its thoughtful plugin architecture. By choosing additional plugins, PocketHost's features can be extended according to your exact needs. You can even write your own plugins.
## The magic `serve` command
`pockethost serve` is a special command that can be decorated with plugins. Plugins can respond to the `serve` command by running their own services.
By convention, plugins that have some kind of `serve` functionality such as running a server, will make it available in two ways.
The first way runs ONLY the plugin's `serve` functionality:
```bash
pockethost <plugin-name> serve
```
The second way runs ALL `serve` functionality from ALL plugins:
```bash
pockethost serve
```
The exact plugins can also be narrowed:
```bash
pockethost serve --only=plugin1,plugin2,plugin3
```
See the plugin authoring guide for more information on how to make a plugin that responds to both methods.
## Configuration ## Configuration
PocketHost supports configuration by environment variable, `.env` file, and also built-in settings via `pockethost config`. PocketHost supports configuration by environment variable, `.env` file, and also built-in settings via `pockethost config`.