| title | Enabling the web interface |
|---|---|
| parent | Examples |
| nav_order | 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.tsto 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/plugin-web-interface",
"options": {
"port": 5000
}
}
]
}cd to /docs/src/examples/basic-webinterface directory.
Start example by running pup run if pup is installed, or something like deno run -A ../../../pup.ts run if not.
Browse to http://localhost:5000/
Success!