title | parent | nav_order |
---|---|---|
Enabling the web interface |
Examples |
3 |
The example at /docs/src/examples/basic-webinterface borrows the server.ts and task.ts from the basic example. Both processes have logging configurations, with the second process having custom logger settings which enable the periodic process to write its logs to separate files.
The web interface plugin is enabled by pup.json
and available at http://localhost:5000/
- pup.jsonc - Pup configuration, sets up
task.ts
to run at cron schedule0/20 * * * * *
(every fifth second), and enables web interface.
To activate the web interface plugin, set up the plugins:
-section of your pup.json
like this:
{
"processes": [/* ... */],
"plugins": [
{
"url": "jsr:@pup/pup@$VERSION/plugins/web-interface/mod.ts",
"options": {
"port": 5000
}
}
]
}
If running pup using the normal release channels stable
or prerelease
, $VERSION
will be replaced by the version of the currently running pup instance. If running a canary
version, or custom
intallation, you can not use the $VERSION
variable, and should give an absolute url.
cd
to /docs/src/examples/basic-webinterface
directory.
Start example by running pup foreground
if pup is installed, or something like deno run -A ../../../pup.ts foreground
if not.
Browse to http://localhost:5000/
Success!