()
| 17 | ) |
| 18 | |
| 19 | func main() { |
| 20 | app := pocketbase.New() |
| 21 | |
| 22 | // --------------------------------------------------------------- |
| 23 | // Optional plugin flags: |
| 24 | // --------------------------------------------------------------- |
| 25 | |
| 26 | var hooksDir string |
| 27 | app.RootCmd.PersistentFlags().StringVar( |
| 28 | &hooksDir, |
| 29 | "hooksDir", |
| 30 | "", |
| 31 | "the directory with the JS app hooks", |
| 32 | ) |
| 33 | |
| 34 | var hooksWatch bool |
| 35 | app.RootCmd.PersistentFlags().BoolVar( |
| 36 | &hooksWatch, |
| 37 | "hooksWatch", |
| 38 | true, |
| 39 | "auto restart the app on pb_hooks file change; it has no effect on Windows", |
| 40 | ) |
| 41 | |
| 42 | var hooksPool int |
| 43 | app.RootCmd.PersistentFlags().IntVar( |
| 44 | &hooksPool, |
| 45 | "hooksPool", |
| 46 | 15, |
| 47 | "the total prewarm goja.Runtime instances for the JS app hooks execution", |
| 48 | ) |
| 49 | |
| 50 | var migrationsDir string |
| 51 | app.RootCmd.PersistentFlags().StringVar( |
| 52 | &migrationsDir, |
| 53 | "migrationsDir", |
| 54 | "", |
| 55 | "the directory with the user defined migrations", |
| 56 | ) |
| 57 | |
| 58 | var automigrate bool |
| 59 | app.RootCmd.PersistentFlags().BoolVar( |
| 60 | &automigrate, |
| 61 | "automigrate", |
| 62 | true, |
| 63 | "enable/disable auto migrations", |
| 64 | ) |
| 65 | |
| 66 | var publicDir string |
| 67 | app.RootCmd.PersistentFlags().StringVar( |
| 68 | &publicDir, |
| 69 | "publicDir", |
| 70 | defaultPublicDir(), |
| 71 | "the directory to serve static files", |
| 72 | ) |
| 73 | |
| 74 | var indexFallback bool |
| 75 | app.RootCmd.PersistentFlags().BoolVar( |
| 76 | &indexFallback, |
nothing calls this directly
no test coverage detected
searching dependent graphs…