Get started with the listmonk integration
Ce contenu n’est pas encore disponible dans votre langue.
listmonk is a self-hosted newsletter and mailing-list manager. The Community Toolkit hosting integration adds its container to an Aspire AppHost and configures it to use a PostgreSQL database resource.
Prerequisites
Section titled “Prerequisites”- An Aspire AppHost project
- A PostgreSQL resource for listmonk’s database
Add listmonk to your AppHost
Section titled “Add listmonk to your AppHost”Install the 📦 CommunityToolkit.Aspire.Hosting.Listmonk package in the AppHost:
aspire add CommunityToolkit.Aspire.Hosting.ListmonkAdd the container and reference a PostgreSQL database. The admin password is an Aspire secret parameter. See Set up listmonk in the AppHost for configuration and persistence options.
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();const password = await builder.addParameter('listmonk-admin-password', { secret: true,});const postgres = await builder.addPostgres('postgres');const database = await postgres.addDatabase('listmonkdb');
const listmonk = await builder.addListmonk('listmonk');await listmonk.withReference(database);await listmonk.withAdminCredentials('admin', password);await listmonk.withUploadsVolume();
await builder.build().run();var builder = DistributedApplication.CreateBuilder(args);var adminPassword = builder.AddParameter("listmonk-admin-password", secret: true);var database = builder.AddPostgres("postgres") .AddDatabase("listmonkdb");
var listmonk = builder.AddListmonk("listmonk") .WithReference(database) .WithAdminCredentials("admin", adminPassword) .WithUploadsVolume();
// After adding all resources, run the app...builder.Build().Run();The hosting integration does not include a listmonk client package. Reference the resource from an app that calls listmonk’s HTTP API, or use the dashboard to administer the instance.