Smallweb 0.10 - Cron jobs are here!

by Achille Lacoin

1 min read

Smallweb now supports cron jobs

Cron jobs were one of the key features missing from smallweb. You can now defines them from the smallweb.json[c] file.

{
  "crons": [
    {
      "name": "my-cron-job",
      "schedule": "0 0 * * *",
      "command": "echo",
      "args": ["hello world!"]
    }
  ]
}

Cron jobs are defined by a name, a schedule, a command, and optional arguments.

The minimum schedule is * * * * * which means every minute. crontab.guru is a great tool to help you define your schedule.

Additionally, two new commands were added to manage cron jobs:

  • smallweb cron list to list all cron jobs
  • smallweb cron trigger to trigger a cron job manually

Make sure to setup the completions for your shell to get the full experience.

More information can be found in the documentation.

smallweb create is now interactive

You can now just run smallweb create to initialize a new project.

It will ask you a few questions and generate a new project for you. You can skip the questions by passing the --name and --template flags.

What's next?

I want to focus on improving the logs experience in the next release.

Currently, all logs are grouped together, and there is no way to filter between:

  • system logs (ex: http requests)
  • application logs (ex: stdout/stderr)

The user should also be able to filter logs by domain, or application.

In order to achieve this, I'm thinking of emitting logs as json to stdout, and converting them to human readable format in the cli.

I also plan to work on:

  • a landing page for smallweb
  • a demo video showcasing the features