इसे छोड़कर कंटेंट पर जाएं
DocsTry Aspire
DocsTry

Get started with the Perl hosting integration

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

⭐ Community Toolkit Perl Camel

The Aspire Community Toolkit Perl hosting integration runs Perl applications alongside the other resources in your AppHost. It models a Perl process as a first-class resource, manages its working directory and dependency installers, and supports local development and Dockerfile-based publishing.

The hosting package belongs in the AppHost. It creates an executable resource for your Perl application, while your project retains its scripts, modules, and dependency files.

architecture-beta

  group apphost(server)[AppHost]
  group perl(logos:perl)[Perl project]

  service hosting(server)[Perl hosting integration] in apphost
  service resource(logos:perl)[Perl app resource] in apphost
  service runtime(logos:perl)[Perl runtime] in perl
  service app(logos:perl)[Perl application] in perl

  hosting:R --> L:resource
  resource:R --> L:runtime
  runtime:R --> L:app
  • Install Perl and ensure perl and cpan are on PATH.
  • Install cpanm when you use WithCpanMinus, WithLocalLib, or project dependency installation without Carton. Install carton when you use Carton.
  • Install the Aspire CLI and create an AppHost.

Add CommunityToolkit.Aspire.Hosting.Perl to your AppHost. The Perl hosting reference includes package installation options.

Add a script resource and use a project-local module directory:

AppHost.cs
var builder = DistributedApplication.CreateBuilder(args);
builder.AddPerlScript("worker", "../perl-worker", "worker.pl")
.WithLocalLib("local");
builder.Build().Run();

The resource’s application directory is its working directory. Put a cpanfile there when you want Aspire to install project dependencies, and add an HTTP endpoint for a web API that listens on a port.

Set up Perl in the AppHost