Serve runs the serve command bundled in the core. For larger projects, consider use full-featured ServeModule instead of calling serve directly.
(ctx context.Context)
| 372 | // Serve runs the serve command bundled in the core. |
| 373 | // For larger projects, consider use full-featured ServeModule instead of calling serve directly. |
| 374 | func (c *C) Serve(ctx context.Context) error { |
| 375 | return c.di.Invoke(func(in serveIn) error { |
| 376 | cmd := newServeCmd(in) |
| 377 | return cmd.ExecuteContext(ctx) |
| 378 | }) |
| 379 | } |
| 380 | |
| 381 | // Shutdown iterates through every CloserProvider registered in the container, |
| 382 | // and calls them in the reversed order of registration. |