Program

A program defines custom program to run with the Teo model entities. The program can be anything from run some scripts and exist to start a server.

The model entity API is exposed to this method. We guarantee the database is connected and every model entity API call is valid.

Define a program

Use the server API to define a program.

app.program("myProgram", None, |teo: Teo| async move {
  // do things with teo
Ok(())
});

Run a program

To run a defined program, use the run command with the command name.

cargo teo run myProgram