This sample project is a simple task manager application using ASP.NET Core for the backend and JavaScript for client-side component rendering.
It showcases how you could deploy a full-stack application with ASP.NET Core and JavaScript using Defang. The Docker setup ensures the app can be easily built and tested during development.
- Download Defang CLI
- (Optional) If you are using Defang BYOC authenticate with your cloud provider account
- (Optional for local development) Docker CLI
- Install ASP.NET Core
For development, we use two local containers, one for the frontend service and one for the backend service in ASP.NET Core. It also uses Caddy as a web server for serving static files.
To run the application locally, you can use the following command:
docker compose -f compose.dev.yaml up --build
For this sample, you will not need to provide configuration.
If you wish to provide configuration, see below for an example of setting a configuration for a value named API_KEY
.
defang config set API_KEY
Note
Download Defang CLI
Deploy your application to the Defang Playground by opening up your terminal and typing:
defang compose up
If you want to deploy to your own cloud account, you can use Defang BYOC:
- Authenticate your AWS account, and check that you have properly set your environment variables like
AWS_PROFILE
,AWS_REGION
,AWS_ACCESS_KEY_ID
, andAWS_SECRET_ACCESS_KEY
. - Run in a terminal that has access to your AWS environment variables:
defang --provider=aws compose up
Title: C# & ASP.NET Core
Short Description: A simple task manager application using C# and ASP.NET Core.
Tags: ASP.NET Core, JavaScript, C#
Languages: C#